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 @@
11const builtin = @import("builtin");
22const std = @import("std");
33
4pub const linkage: std.builtin.GlobalLinkage = if (builtin.is_test)
5 .internal
6else
7 .strong;
4/// It is incorrect to make this conditional on `builtin.is_test`, because it is possible that
5/// libzigc is being linked into a different test compilation, as opposed to being tested itself.
6pub const linkage: std.builtin.GlobalLinkage = .strong;
87
98/// Determines the symbol's visibility to other objects.
109/// For WebAssembly this allows the symbol to be resolved to other modules, but will not
1110/// export it to the host runtime.
12pub const visibility: std.builtin.SymbolVisibility = if (linkage != .internal)
13 .hidden
14else
15 .default;
11pub const visibility: std.builtin.SymbolVisibility = .hidden;
1612
1713/// Given a low-level syscall return value, sets errno and returns `-1`, or on
1814/// success returns the result.