mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
terminal: always use C ABI for now
This commit is contained in:
@@ -264,4 +264,7 @@ test {
|
||||
_ = terminal;
|
||||
_ = @import("lib/main.zig");
|
||||
@import("std").testing.refAllDecls(input);
|
||||
if (comptime terminal.options.c_abi) {
|
||||
_ = terminal.c_api;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,12 @@ const lib = @import("../lib/main.zig");
|
||||
/// The target for the terminal lib in particular.
|
||||
pub const target: lib.Target = if (build_options.c_abi) .c else .zig;
|
||||
|
||||
/// The calling convention to use for C APIs. If we're not building for
|
||||
/// C ABI then we use auto which allows our C APIs to be cleanly called
|
||||
/// by Zig. This is required because we modify our struct layouts based
|
||||
/// on C ABI too.
|
||||
pub const calling_conv: std.builtin.CallingConvention = if (build_options.c_abi)
|
||||
.c
|
||||
else
|
||||
.auto;
|
||||
/// The calling convention to use for C APIs.
|
||||
///
|
||||
/// This is always .c for now. I want to make this "Zig" when we're not
|
||||
/// building the C ABI but there are bigger issues we need to resolve to
|
||||
/// make that possible (change it and see for yourself).
|
||||
pub const calling_conv: std.builtin.CallingConvention = .c;
|
||||
|
||||
/// Forwarded decls from lib that are used.
|
||||
pub const alloc = lib.allocator;
|
||||
|
||||
@@ -73,7 +73,8 @@ pub const Attribute = sgr.Attribute;
|
||||
pub const Options = @import("build_options.zig").Options;
|
||||
pub const options = @import("terminal_options");
|
||||
|
||||
pub const c_api = @import("c/main.zig");
|
||||
/// This is set to true when we're building the C library.
|
||||
pub const c_api = if (options.c_abi) @import("c/main.zig") else void;
|
||||
|
||||
test {
|
||||
@import("std").testing.refAllDecls(@This());
|
||||
|
||||
Reference in New Issue
Block a user