Skip to content

Commit aa9e1ae

Browse files
committed
Fix windows build
1 parent b5f6239 commit aa9e1ae

File tree

3 files changed

+26
-25
lines changed

3 files changed

+26
-25
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
/version -merge
2+
/config/config.h.in eol=LF

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/zig-cache
2-
/zig-out
1+
/.zig-cache
2+
/zig-out

build.zig

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ pub fn build(b: *std.Build) void {
8989
.HAVE_DECL_STRICMP = 0,
9090
.HAVE_DECL_STRLCPY = 0,
9191
.HAVE_DECL_STRNCASECMP = 0,
92-
.HAVE_DECL_STRNICMP = 0,
93-
.HAVE_DECL_STRNLEN = 0,
92+
.HAVE_DECL_STRNICMP = @as(u32, if(target.result.os.tag == .windows) 1 else 0),
93+
.HAVE_DECL_STRNLEN = @as(u32, if(target.result.os.tag == .windows) 1 else 0),
9494
.HAVE_DECL_STRRCHRNUL = 0,
9595
.HAVE_DECL_STRSEP = 0,
96-
.HAVE_ENDIAN_H = 1,
96+
.HAVE_ENDIAN_H = have(target.result.os.tag != .windows),
9797
.HAVE_FACCESSAT = 1,
9898
.HAVE_FCNTL_H = 1,
9999
.HAVE_FILENO = 1,
@@ -132,16 +132,16 @@ pub fn build(b: *std.Build) void {
132132
.HAVE_HTOLE64 = null,
133133
.HAVE_INTRIN_H = 1,
134134
.HAVE_INTTYPES_H = 1,
135-
.HAVE_IO_H = null,
135+
.HAVE_IO_H = have(target.result.os.tag == .windows),
136136
.HAVE_ISASCII = 1,
137137
.HAVE_ISCNTRL = 1,
138-
.HAVE_MACHINE_ENDIAN_H = 1,
138+
.HAVE_MACHINE_ENDIAN_H = have(target.result.os.tag != .windows),
139139
.HAVE_MEMPCPY = 1,
140140
.HAVE_MEMPSET = null,
141141
.HAVE_MINIX_CONFIG_H = null,
142-
.HAVE_MMAP = 1,
142+
.HAVE_MMAP = have(target.result.os.tag != .windows),
143143
.HAVE_PATHCONF = null,
144-
.HAVE_REALPATH = 1,
144+
.HAVE_REALPATH = have(target.result.os.tag != .windows),
145145
.HAVE_SNPRINTF = 1,
146146
.HAVE_STAT = 1,
147147
.HAVE_STDARG_H = 1,
@@ -151,21 +151,21 @@ pub fn build(b: *std.Build) void {
151151
.HAVE_STDIO_H = 1,
152152
.HAVE_STDLIB_H = 1,
153153
.HAVE_STDNORETURN_H = 1,
154-
.HAVE_STRCASECMP = 1,
155-
.HAVE_STRICMP = 1,
154+
.HAVE_STRCASECMP = have(target.result.os.tag != .windows),
155+
.HAVE_STRICMP = have(target.result.os.tag != .windows),
156156
.HAVE_STRINGS_H = 1,
157157
.HAVE_STRING_H = 1,
158158
.HAVE_STRLCPY = null,
159-
.HAVE_STRNCASECMP = 1,
160-
.HAVE_STRNICMP = 1,
161-
.HAVE_STRNLEN = 1,
159+
.HAVE_STRNCASECMP = have(target.result.os.tag != .windows),
160+
.HAVE_STRNICMP = have(target.result.os.tag != .windows),
161+
.HAVE_STRNLEN = have(target.result.os.tag == .windows),
162162
.HAVE_STRRCHRNUL = null,
163163
.HAVE_STRSEP = null,
164164
.HAVE_STRUCT_STAT = null,
165-
.HAVE_STRUCT__STATI64 = null,
165+
.HAVE_STRUCT__STATI64 = have(target.result.os.tag == .windows),
166166
.HAVE_SYSCONF = null,
167-
.HAVE_SYS_ENDIAN_H = 1,
168-
.HAVE_SYS_MMAN_H = 1,
167+
.HAVE_SYS_ENDIAN_H = have(target.result.os.tag != .windows),
168+
.HAVE_SYS_MMAN_H = have(target.result.os.tag != .windows),
169169
.HAVE_SYS_PARAM_H = null,
170170
.HAVE_SYS_RESOURCE_H = null,
171171
.HAVE_SYS_STAT_H = 1,
@@ -174,7 +174,7 @@ pub fn build(b: *std.Build) void {
174174
.HAVE_TYPEOF = null,
175175
.HAVE_UINTPTR_T = 1,
176176
.HAVE_UNISTD_H = null,
177-
.HAVE_VSNPRINTF = null,
177+
.HAVE_VSNPRINTF = have(target.result.os.tag == .windows),
178178
.HAVE_WCHAR_H = null,
179179
.HAVE__ACCESS = null,
180180
.HAVE__BITSCANREVERSE = null,
@@ -183,13 +183,13 @@ pub fn build(b: *std.Build) void {
183183
.HAVE__BYTESWAP_UINT64 = null,
184184
.HAVE__BYTESWAP_ULONG = null,
185185
.HAVE__BYTESWAP_USHORT = null,
186-
.HAVE__CHSIZE = null,
187-
.HAVE__CHSIZE_S = null,
188-
.HAVE__FILENO = null,
189-
.HAVE__FSEEKI64 = null,
190-
.HAVE__FSTATI64 = null,
191-
.HAVE__FULLPATH = null,
192-
.HAVE__STATI64 = null,
186+
.HAVE__CHSIZE = have(target.result.os.tag == .windows),
187+
.HAVE__CHSIZE_S = have(target.result.os.tag == .windows),
188+
.HAVE__FILENO = have(target.result.os.tag == .windows),
189+
.HAVE__FSEEKI64 = have(target.result.os.tag == .windows),
190+
.HAVE__FSTATI64 = have(target.result.os.tag == .windows),
191+
.HAVE__FULLPATH = have(target.result.os.tag == .windows),
192+
.HAVE__STATI64 = have(target.result.os.tag == .windows),
193193
.HAVE___BSWAP_16 = 1,
194194
.HAVE___BSWAP_32 = 1,
195195
.HAVE___BSWAP_64 = 1,

0 commit comments

Comments
 (0)