| ... | @@ -1,18 +1,14 @@ | ... | @@ -1,18 +1,14 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const std = @import("std"); | 2 | const std = @import("std"); |
| 3 | | 3 | |
| 4 | pub 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 | .internal | 5 | /// libzigc is being linked into a different test compilation, as opposed to being tested itself. |
| 6 | else | 6 | pub const linkage: std.builtin.GlobalLinkage = .strong; |
| 7 | .strong; | | |
| 8 | | 7 | |
| 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 not | 9 | /// 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. |
| 12 | pub const visibility: std.builtin.SymbolVisibility = if (linkage != .internal) | 11 | pub const visibility: std.builtin.SymbolVisibility = .hidden; |
| 13 | .hidden | | |
| 14 | else | | |
| 15 | .default; | | |
| 16 | | 12 | |
| 17 | /// Given a low-level syscall return value, sets errno and returns `-1`, or on | 13 | /// Given a low-level syscall return value, sets errno and returns `-1`, or on |
| 18 | /// success returns the result. | 14 | /// success returns the result. |