From ed93f0d70f5b3f954a4f52e37cab80383ca61413 Mon Sep 17 00:00:00 2001 From: GasInfinity Date: Thu, 29 Jan 2026 10:39:38 +0100 Subject: [PATCH] fix(libzigc): always apply strong linkage, even when testing * libzigc may be linked into a different test compilation Co-authored-by: Matthew Lugg --- lib/c/common.zig | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/c/common.zig b/lib/c/common.zig index 8d2a79db54b33515ef75c98bf5eb1defe23cb19a..5cd94cf0ceedf73986b5b0217d4e285fac45f735 100644 --- a/lib/c/common.zig +++ b/lib/c/common.zig @@ -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. -- 2.54.0