From c414e090d8eecb1c1de1756dabc46d14ed72205a Mon Sep 17 00:00:00 2001 From: Manuel Schiller Date: Mon, 30 Mar 2026 22:53:34 +0200 Subject: [PATCH 1/2] fix: make platform-specific headers and functions conditional for macOS builds --- build.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.zig b/build.zig index b9bb1ff0..50446bc0 100644 --- a/build.zig +++ b/build.zig @@ -90,13 +90,13 @@ pub fn build(b: *std.Build) void { .HAVE_CPU_TO_LE64 = null, .HAVE_DECL_STRCASECMP = 0, .HAVE_DECL_STRICMP = 0, - .HAVE_DECL_STRLCPY = 0, + .HAVE_DECL_STRLCPY = @as(c_int, if (t.os.tag.isDarwin()) 1 else 0), .HAVE_DECL_STRNCASECMP = 0, .HAVE_DECL_STRNICMP = 0, .HAVE_DECL_STRNLEN = 0, .HAVE_DECL_STRRCHRNUL = 0, .HAVE_DECL_STRSEP = 0, - .HAVE_ENDIAN_H = 1, + .HAVE_ENDIAN_H = have(t.os.tag == .linux), .HAVE_FACCESSAT = 1, .HAVE_FCNTL_H = 1, .HAVE_FILENO = 1, @@ -139,7 +139,7 @@ pub fn build(b: *std.Build) void { .HAVE_ISASCII = 1, .HAVE_ISCNTRL = 1, .HAVE_MACHINE_ENDIAN_H = 1, - .HAVE_MEMPCPY = 1, + .HAVE_MEMPCPY = have(t.os.tag == .linux), .HAVE_MEMPSET = null, .HAVE_MINIX_CONFIG_H = null, .HAVE_MMAP = 1, @@ -158,7 +158,7 @@ pub fn build(b: *std.Build) void { .HAVE_STRICMP = 1, .HAVE_STRINGS_H = 1, .HAVE_STRING_H = 1, - .HAVE_STRLCPY = null, + .HAVE_STRLCPY = have(t.os.tag.isDarwin()), .HAVE_STRNCASECMP = 1, .HAVE_STRNICMP = 1, .HAVE_STRNLEN = 1, @@ -177,7 +177,7 @@ pub fn build(b: *std.Build) void { .HAVE_TYPEOF = null, .HAVE_UINTPTR_T = 1, .HAVE_UNISTD_H = null, - .HAVE_VSNPRINTF = null, + .HAVE_VSNPRINTF = 1, .HAVE_WCHAR_H = null, .HAVE__ACCESS = null, .HAVE__BITSCANREVERSE = null, From 085a71c25d7f348236bdaa05a2f5aa996a0db847 Mon Sep 17 00:00:00 2001 From: Manuel Schiller Date: Tue, 31 Mar 2026 07:37:38 +0200 Subject: [PATCH 2/2] fix: broaden platform conditionals to all BSDs and fix strsep/endian --- build.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.zig b/build.zig index 50446bc0..c8b8117e 100644 --- a/build.zig +++ b/build.zig @@ -90,12 +90,12 @@ pub fn build(b: *std.Build) void { .HAVE_CPU_TO_LE64 = null, .HAVE_DECL_STRCASECMP = 0, .HAVE_DECL_STRICMP = 0, - .HAVE_DECL_STRLCPY = @as(c_int, if (t.os.tag.isDarwin()) 1 else 0), + .HAVE_DECL_STRLCPY = @as(c_int, if (t.os.tag.isBSD()) 1 else 0), .HAVE_DECL_STRNCASECMP = 0, .HAVE_DECL_STRNICMP = 0, .HAVE_DECL_STRNLEN = 0, .HAVE_DECL_STRRCHRNUL = 0, - .HAVE_DECL_STRSEP = 0, + .HAVE_DECL_STRSEP = @as(c_int, if (t.os.tag.isBSD()) 1 else 0), .HAVE_ENDIAN_H = have(t.os.tag == .linux), .HAVE_FACCESSAT = 1, .HAVE_FCNTL_H = 1, @@ -138,7 +138,7 @@ pub fn build(b: *std.Build) void { .HAVE_IO_H = null, .HAVE_ISASCII = 1, .HAVE_ISCNTRL = 1, - .HAVE_MACHINE_ENDIAN_H = 1, + .HAVE_MACHINE_ENDIAN_H = have(t.os.tag.isBSD()), .HAVE_MEMPCPY = have(t.os.tag == .linux), .HAVE_MEMPSET = null, .HAVE_MINIX_CONFIG_H = null, @@ -158,16 +158,16 @@ pub fn build(b: *std.Build) void { .HAVE_STRICMP = 1, .HAVE_STRINGS_H = 1, .HAVE_STRING_H = 1, - .HAVE_STRLCPY = have(t.os.tag.isDarwin()), + .HAVE_STRLCPY = have(t.os.tag.isBSD()), .HAVE_STRNCASECMP = 1, .HAVE_STRNICMP = 1, .HAVE_STRNLEN = 1, .HAVE_STRRCHRNUL = null, - .HAVE_STRSEP = null, + .HAVE_STRSEP = have(t.os.tag.isBSD()), .HAVE_STRUCT_STAT = null, .HAVE_STRUCT__STATI64 = null, .HAVE_SYSCONF = null, - .HAVE_SYS_ENDIAN_H = 1, + .HAVE_SYS_ENDIAN_H = have(t.os.tag.isBSD()), .HAVE_SYS_MMAN_H = 1, .HAVE_SYS_PARAM_H = null, .HAVE_SYS_RESOURCE_H = null,