aboutsummaryrefslogtreecommitdiff
path: root/lib/zig.h
diff options
context:
space:
mode:
authorkcbanner <kcbanner@gmail.com>2023-11-05 00:27:08 -0400
committerkcbanner <kcbanner@gmail.com>2023-11-05 20:34:13 -0500
commit26dabbf301ce4cd950cd66373dc17f0747c1e813 (patch)
tree712d1971bf81fc0dc1bb5aaf3003ef555d658cdd /lib/zig.h
parent192e9a315d92133b27d757f18bd4fd619976b755 (diff)
downloadzig-26dabbf301ce4cd950cd66373dc17f0747c1e813.tar.gz
zig-26dabbf301ce4cd950cd66373dc17f0747c1e813.zip
cbe: handle underscore prexfix on macos, don't mangle extern function names
Diffstat (limited to 'lib/zig.h')
-rw-r--r--lib/zig.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/zig.h b/lib/zig.h
index c188b6e5c7..032ad30053 100644
--- a/lib/zig.h
+++ b/lib/zig.h
@@ -203,7 +203,11 @@ typedef char bool;
__pragma(comment(linker, "/alternatename:_" #symbol "=_" #name ))
#endif /*_M_X64 */
#else
+#if __APPLE__
+#define zig_import(sig, symbol, name) zig_extern sig __asm("_" #name);
+#else /* __APPLE__ */
#define zig_import(sig, symbol, name) zig_extern sig __asm(#name);
+#endif /* __APPLE__ */
#endif
#define zig_expand_import(sig, symbol, name) zig_import(sig, symbol, name)