diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-08-01 23:48:14 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-08-03 09:52:14 -0700 |
| commit | 986a3d23abcbdb61fd733d2340d4872b6ee55dca (patch) | |
| tree | 9efe038889e06038573ead7e3596802585dc977a /src/link.zig | |
| parent | e565ff305ae208b15058a462d348fde515b3e950 (diff) | |
| download | zig-986a3d23abcbdb61fd733d2340d4872b6ee55dca.tar.gz zig-986a3d23abcbdb61fd733d2340d4872b6ee55dca.zip | |
frontend: make SystemLib.path optional
This can be null in two cases right now:
1. Windows DLLs that zig ships such as advapi32.
2. extern "foo" fn declarations where we find out about libraries too late
TODO: make this non-optional and resolve those two cases somehow.
Diffstat (limited to 'src/link.zig')
| -rw-r--r-- | src/link.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/link.zig b/src/link.zig index 9edba50123..6e5921d815 100644 --- a/src/link.zig +++ b/src/link.zig @@ -26,7 +26,11 @@ const TypedValue = @import("TypedValue.zig"); pub const SystemLib = struct { needed: bool, weak: bool, - path: []const u8, + /// This can be null in two cases right now: + /// 1. Windows DLLs that zig ships such as advapi32. + /// 2. extern "foo" fn declarations where we find out about libraries too late + /// TODO: make this non-optional and resolve those two cases somehow. + path: ?[]const u8, }; /// When adding a new field, remember to update `hashAddFrameworks`. @@ -48,7 +52,7 @@ pub fn hashAddSystemLibs( for (hm.values()) |value| { man.hash.add(value.needed); man.hash.add(value.weak); - _ = try man.addFile(value.path, null); + if (value.path) |p| _ = try man.addFile(p, null); } } |
