authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-07-02 12:42:06+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-07-02 13:02:35+02:00
logc5879812be778d529b5125cf6ab44a14917b8cb2
treef7163f258415da5f30a9f6ec8857d907dcd322f1
parent7f89b5860c765b76c0ef4f07c214e5110ed59bec
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

libzigc: MinGW-w64 now provides strndup()


1 files changed, 2 insertions(+), 1 deletions(-)

lib/c/string.zig+2-1
...@@ -4,6 +4,8 @@ const symbol = @import("../c.zig").symbol;...@@ -4,6 +4,8 @@ const symbol = @import("../c.zig").symbol;
4const c = std.c;4const c = std.c;
55
6comptime {6comptime {
7 symbol(&strndup, "strndup");
8
7 if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {9 if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) {
8 // memcpy implemented in compiler_rt10 // memcpy implemented in compiler_rt
9 // memmove implemented in compiler_rt11 // memmove implemented in compiler_rt
...@@ -26,7 +28,6 @@ comptime {...@@ -26,7 +28,6 @@ comptime {
26 symbol(&strstr, "strstr");28 symbol(&strstr, "strstr");
27 symbol(&strtok, "strtok");29 symbol(&strtok, "strtok");
28 symbol(&strdup, "strdup");30 symbol(&strdup, "strdup");
29 symbol(&strndup, "strndup");
30 // strlen is in compiler_rt31 // strlen is in compiler_rt
3132
32 symbol(&strtok_r, "strtok_r");33 symbol(&strtok_r, "strtok_r");