mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
fix(libzigc): always apply strong linkage, even when testing
* libzigc may be linked into a different test compilation Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk>
This commit is contained in:
parent
e7baa09ce4
commit
ed93f0d70f
1 changed files with 4 additions and 8 deletions
|
|
@ -1,18 +1,14 @@
|
|||
const builtin = @import("builtin");
|
||||
const std = @import("std");
|
||||
|
||||
pub const linkage: std.builtin.GlobalLinkage = if (builtin.is_test)
|
||||
.internal
|
||||
else
|
||||
.strong;
|
||||
/// It is incorrect to make this conditional on `builtin.is_test`, because it is possible that
|
||||
/// libzigc is being linked into a different test compilation, as opposed to being tested itself.
|
||||
pub const linkage: std.builtin.GlobalLinkage = .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 (linkage != .internal)
|
||||
.hidden
|
||||
else
|
||||
.default;
|
||||
pub const visibility: std.builtin.SymbolVisibility = .hidden;
|
||||
|
||||
/// Given a low-level syscall return value, sets errno and returns `-1`, or on
|
||||
/// success returns the result.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue