Commit 8aacfc8465

Andrew Kelley <superjoe30@gmail.com>
2018-08-25 10:37:55
add workaround on macos for shared libraries
1 parent 02f5a9f
Changed files (1)
example
shared_library
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;
 }