mach: improve compatibility with self-hosted compiler

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-20 11:41:01 -07:00
parent e92572b776
commit 72b081c97a
3 changed files with 47 additions and 19 deletions

View file

@ -632,7 +632,10 @@ pub fn coreDeinit(core: *Core, allocator: std.mem.Allocator) void {
allocator.destroy(core);
}
pub const CoreResizeCallback = fn (*Core, u32, u32) callconv(.C) void;
pub const CoreResizeCallback = if (@import("builtin").zig_backend == .stage1)
fn (*Core, u32, u32) callconv(.C) void
else
*const fn (*Core, u32, u32) callconv(.C) void;
pub fn coreUpdate(core: *Core, resize: ?CoreResizeCallback) !void {
if (core.internal.wait_event_timeout > 0.0) {