Skip to content

Commit

Permalink
Undefine HAVE_{AMD64,AVX}_ASM with the Windows calling convention
Browse files Browse the repository at this point in the history
Fixes #1371
  • Loading branch information
jedisct1 committed May 23, 2024
1 parent 2e662fb commit e9cc216
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ fn initLibConfig(b: *std.Build, target: std.Build.ResolvedTarget, lib: *Compile)
lib.defineCMacro("HAVE_CATCHABLE_SEGV", "1");
lib.defineCMacro("HAVE_CLOCK_GETTIME", "1");
lib.defineCMacro("HAVE_GETPID", "1");
lib.defineCMacro("HAVE_INLINE_ASM", "1");
lib.defineCMacro("HAVE_MADVISE", "1");
lib.defineCMacro("HAVE_MLOCK", "1");
lib.defineCMacro("HAVE_MMAP", "1");
Expand Down Expand Up @@ -104,8 +103,13 @@ fn initLibConfig(b: *std.Build, target: std.Build.ResolvedTarget, lib: *Compile)

switch (target.result.cpu.arch) {
.x86_64 => {
lib.defineCMacro("HAVE_AMD64_ASM", "1");
lib.defineCMacro("HAVE_AVX_ASM", "1");
switch (target.result.os.tag) {
.windows => {},
else => {
lib.defineCMacro("HAVE_AMD64_ASM", "1");
lib.defineCMacro("HAVE_AVX_ASM", "1");
},
}
lib.defineCMacro("HAVE_CPUID", "1");
lib.defineCMacro("HAVE_MMINTRIN_H", "1");
lib.defineCMacro("HAVE_EMMINTRIN_H", "1");
Expand Down

0 comments on commit e9cc216

Please sign in to comment.