diff --git a/lib/zig.h b/lib/zig.h index 14fd1a2b9c..3a3489cc89 100644 --- 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 index e75cf6ec3b..883303c4f8 100644 --- 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()); }