diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-04-12 18:14:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-12 18:14:17 +0200 |
| commit | 9352f379e8a08bcc5a3bfc851bfb6c6a662000af (patch) | |
| tree | 9fee8a3b98ab806c02aab3a6e9646ccea08f40f1 /lib/c/common.zig | |
| parent | 4e700fdf8ed01e7fc856e631ceffd6006e6f48df (diff) | |
| parent | 1f896c1bf89aa0e3d2a0dce1f4cf6ba6ce5ae9ed (diff) | |
| download | zig-9352f379e8a08bcc5a3bfc851bfb6c6a662000af.tar.gz zig-9352f379e8a08bcc5a3bfc851bfb6c6a662000af.zip | |
Merge pull request #23529 from alexrp/2879-groundwork
Introduce libzigc for libc function implementations in Zig
Diffstat (limited to 'lib/c/common.zig')
| -rw-r--r-- | lib/c/common.zig | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/c/common.zig b/lib/c/common.zig new file mode 100644 index 0000000000..e9536f63b4 --- /dev/null +++ b/lib/c/common.zig @@ -0,0 +1,15 @@ +const builtin = @import("builtin"); +const std = @import("std"); + +pub const linkage: std.builtin.GlobalLinkage = if (builtin.is_test) + .internal +else + .strong; + +/// Determines the symbol's visibility to other objects. +/// For WebAssembly this allows the symbol to be resolved to other modules, but will not +/// export it to the host runtime. +pub const visibility: std.builtin.SymbolVisibility = if (builtin.cpu.arch.isWasm() and linkage != .internal) + .hidden +else + .default; |
