zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 50e2fb8fd0e1aae5fc3123d6f26d7420d4baa41c (tree)
parent 8c0e0cd3535d4e59a01dc49f9b93c922ca63114f
Author: kcbanner <kcbanner@gmail.com>
Date:   Sun,  5 Nov 2023 23:36:11 -0500

cbe: fixup __asm style exports, re-enable 12680 on macos now that alias isn't used

Diffstat:
Mlib/zig.h | 6++++--
Mtest/behavior/bugs/12680.zig | 5-----
2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/lib/zig.h b/lib/zig.h @@ -194,9 +194,11 @@ typedef char bool; #endif /*_M_X64 */ #else /* _MSC_VER */ #if __APPLE__ -#define zig_export(sig, symbol, name) __asm("_" name " = _" #symbol) +#define zig_export(sig, symbol, name) zig_extern sig;\ + __asm("_" name " = _" #symbol) #else /* __APPLE__ */ -#define zig_export(sig, symbol, name) __asm(name " = " #symbol) +#define zig_export(sig, symbol, name) zig_extern sig;\ + __asm(name " = " #symbol) #endif /* __APPLE__ */ #endif /* _MSC_VER */ diff --git a/test/behavior/bugs/12680.zig b/test/behavior/bugs/12680.zig @@ -12,11 +12,6 @@ test "export a function twice" { if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf) return error.SkipZigTest; - if (builtin.os.tag == .macos and builtin.zig_backend == .stage2_c) { - // TODO: test.c: error: aliases are not supported on darwin - return error.SkipZigTest; - } - // If it exports the function correctly, `test_func` and `testFunc` will points to the same address. try expectEqual(test_func(), other_file.testFunc()); }