aboutsummaryrefslogtreecommitdiff
path: root/stage1/zig.h
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-04-29 00:19:55 -0700
committerGitHub <noreply@github.com>2023-04-29 00:19:55 -0700
commitd65b42e07caa00dfe2f2fbf221c593ce57882784 (patch)
tree7926cbea1499e0affe930bf6d7455dc24adf014e /stage1/zig.h
parentfd6200eda6d4fe19c34a59430a88a9ce38d6d7a4 (diff)
parentfa200ca0cad2705bad40eb723dedf4e3bf11f2ff (diff)
downloadzig-d65b42e07caa00dfe2f2fbf221c593ce57882784.tar.gz
zig-d65b42e07caa00dfe2f2fbf221c593ce57882784.zip
Merge pull request #15481 from ziglang/use-mem-intrinsics
actually use the new memory intrinsics
Diffstat (limited to 'stage1/zig.h')
-rw-r--r--stage1/zig.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/stage1/zig.h b/stage1/zig.h
index f73dfb72ef..34407d8cda 100644
--- a/stage1/zig.h
+++ b/stage1/zig.h
@@ -188,6 +188,14 @@ typedef char bool;
#define zig_export(sig, symbol, name) __asm(name " = " symbol)
#endif
+#if zig_has_attribute(weak) || defined(zig_gnuc)
+#define zig_weak_linkage __attribute__((weak))
+#elif _MSC_VER
+#define zig_weak_linkage __declspec(selectany)
+#else
+#define zig_weak_linkage zig_weak_linkage_unavailable
+#endif
+
#if zig_has_builtin(trap)
#define zig_trap() __builtin_trap()
#elif _MSC_VER && (_M_IX86 || _M_X64)