| author | |
| committer | |
| log | 50e2fb8fd0e1aae5fc3123d6f26d7420d4baa41c |
| tree | a702af215eae124d4289d1ac5364571a101228b8 |
| parent | 8c0e0cd3535d4e59a01dc49f9b93c922ca63114f |
2 files changed, 4 insertions(+), 7 deletions(-)
lib/zig.h+4-2| ... | @@ -194,9 +194,11 @@ typedef char bool; | ... | @@ -194,9 +194,11 @@ typedef char bool; |
| 194 | #endif /*_M_X64 */ | 194 | #endif /*_M_X64 */ |
| 195 | #else /* _MSC_VER */ | 195 | #else /* _MSC_VER */ |
| 196 | #if __APPLE__ | 196 | #if __APPLE__ |
| 197 | #define zig_export(sig, symbol, name) __asm("_" name " = _" #symbol) | 197 | #define zig_export(sig, symbol, name) zig_extern sig;\ |
| 198 | __asm("_" name " = _" #symbol) | ||
| 198 | #else /* __APPLE__ */ | 199 | #else /* __APPLE__ */ |
| 199 | #define zig_export(sig, symbol, name) __asm(name " = " #symbol) | 200 | #define zig_export(sig, symbol, name) zig_extern sig;\ |
| 201 | __asm(name " = " #symbol) | ||
| 200 | #endif /* __APPLE__ */ | 202 | #endif /* __APPLE__ */ |
| 201 | #endif /* _MSC_VER */ | 203 | #endif /* _MSC_VER */ |
| 202 | 204 |
test/behavior/bugs/12680.zig-5| ... | @@ -12,11 +12,6 @@ test "export a function twice" { | ... | @@ -12,11 +12,6 @@ test "export a function twice" { |
| 12 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; | 12 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; |
| 13 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf) return error.SkipZigTest; | 13 | if (builtin.zig_backend == .stage2_x86_64 and builtin.target.ofmt != .elf) return error.SkipZigTest; |
| 14 | 14 | ||
| 15 | if (builtin.os.tag == .macos and builtin.zig_backend == .stage2_c) { | ||
| 16 | // TODO: test.c: error: aliases are not supported on darwin | ||
| 17 | return error.SkipZigTest; | ||
| 18 | } | ||
| 19 | |||
| 20 | // If it exports the function correctly, `test_func` and `testFunc` will points to the same address. | 15 | // If it exports the function correctly, `test_func` and `testFunc` will points to the same address. |
| 21 | try expectEqual(test_func(), other_file.testFunc()); | 16 | try expectEqual(test_func(), other_file.testFunc()); |
| 22 | } | 17 | } |