From e9cc216804dc9c3f35662c7930a349c5a6756503 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Thu, 23 May 2024 15:47:02 +0200 Subject: [PATCH] Undefine HAVE_{AMD64,AVX}_ASM with the Windows calling convention Fixes #1371 --- build.zig | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build.zig b/build.zig index 83a0e9be..d15afdc6 100644 --- a/build.zig +++ b/build.zig @@ -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"); @@ -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");