nats-c.build.zig: fix cross-compiling from Linux

There is a case-sensitivity issue here. The Windows documentation calls
the library Ws2_32, but the mingw cross-compilation on Linux fails
unless it is called `ws3_32`. For some reason, both work on macOS. I
have not tried on Windows, but I assume this will probably work there
due to everything being extremely insensitive (case-wise) on Windows.
This commit is contained in:
torque 2023-08-16 23:30:04 -07:00
parent 3cf173c923
commit 4a7635fa7b
Signed by: torque
SSH Key Fingerprint: SHA256:nCrXefBNo6EbjNSQhv0nXmEg/VuNq3sMF5b8zETw3Tk

View File

@ -36,7 +36,7 @@ pub fn nats_c_lib(
lib.addCSourceFiles(&.{"src/win-crosshack.c"}, &.{"-fno-sanitize=undefined"});
}
lib.defineCMacro("_WIN32", null);
lib.linkSystemLibrary("Ws2_32");
lib.linkSystemLibrary("ws2_32");
},
.macos => {
lib.addCSourceFiles(&unix_sources, &.{"-fno-sanitize=undefined"});