diff --git a/lib/c/string.zig b/lib/c/string.zig index ee4f7eb9b204b34a947821fb2038f4317e60a0a4..2cd0c0467b46e06370f2e1d7de58a34db7d38584 100644 --- a/lib/c/string.zig +++ b/lib/c/string.zig @@ -4,6 +4,8 @@ const symbol = @import("../c.zig").symbol; const c = std.c; comptime { + symbol(&strndup, "strndup"); + if (builtin.target.isMuslLibC() or builtin.target.isWasiLibC()) { // memcpy implemented in compiler_rt // memmove implemented in compiler_rt @@ -26,7 +28,6 @@ comptime { symbol(&strstr, "strstr"); symbol(&strtok, "strtok"); symbol(&strdup, "strdup"); - symbol(&strndup, "strndup"); // strlen is in compiler_rt symbol(&strtok_r, "strtok_r");