authorgravatar for me@gasinfinity.devGasInfinity <me@gasinfinity.dev> 2026-01-29 10:39:38+01:00
committergravatar for me@gasinfinity.devGasInfinity <me@gasinfinity.dev> 2026-01-29 10:39:38+01:00
loged93f0d70f5b3f954a4f52e37cab80383ca61413
treef341b9fba6b4025174b39fcdb6abc6b1d4df6dff
parente7baa09ce46181a5ffd55879a24a8cb72cea3093
signaturebadge-check Signed by SSH key SHA256:p3IHbr0lyK2ekfDC1Zi7dOEV/9T6lGghNawhl5sBnM4

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>

1 files changed, 4 insertions(+), 8 deletions(-)

lib/c/common.zig+4-8
...@@ -1,18 +1,14 @@...@@ -1,18 +1,14 @@
1const builtin = @import("builtin");1const builtin = @import("builtin");
2const std = @import("std");2const std = @import("std");
33
4pub const linkage: std.builtin.GlobalLinkage = if (builtin.is_test)4/// It is incorrect to make this conditional on `builtin.is_test`, because it is possible that
5 .internal5/// libzigc is being linked into a different test compilation, as opposed to being tested itself.
6else6pub const linkage: std.builtin.GlobalLinkage = .strong;
7 .strong;
87
9/// Determines the symbol's visibility to other objects.8/// Determines the symbol's visibility to other objects.
10/// For WebAssembly this allows the symbol to be resolved to other modules, but will not9/// For WebAssembly this allows the symbol to be resolved to other modules, but will not
11/// export it to the host runtime.10/// export it to the host runtime.
12pub const visibility: std.builtin.SymbolVisibility = if (linkage != .internal)11pub const visibility: std.builtin.SymbolVisibility = .hidden;
13 .hidden
14else
15 .default;
1612
17/// Given a low-level syscall return value, sets errno and returns `-1`, or on13/// Given a low-level syscall return value, sets errno and returns `-1`, or on
18/// success returns the result.14/// success returns the result.