commit 8aacfc846523aad142537b2bff49162d5feb6a91 (tree) parent 02f5a9fa62cc54835467e36b7015a6bcb642583d Author: Andrew Kelley <superjoe30@gmail.com> Date: Sat, 25 Aug 2018 04:37:55 -0400 add workaround on macos for shared libraries Diffstat:
| M | example/shared_library/mathtest.zig | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/example/shared_library/mathtest.zig b/example/shared_library/mathtest.zig @@ -1,3 +1,12 @@ +// TODO Remove this workaround +comptime { + const builtin = @import("builtin"); + if (builtin.os == builtin.Os.macosx) { + @export("__mh_execute_header", _mh_execute_header, builtin.GlobalLinkage.Weak); + } +} +var _mh_execute_header = extern struct {x: usize}{.x = 0}; + export fn add(a: i32, b: i32) i32 { return a + b; }