From d997990ceba3db5fe56daf98ea192aa5ea52f216 Mon Sep 17 00:00:00 2001 From: Uladzimir Karpenka Date: Tue, 2 Jun 2026 12:54:56 +0300 Subject: [PATCH] Fix two Windows cross-compilation errors in analyzer.c WDSP_FPE_GUARD: the macro is defined only in linux_port.h under #if defined(linux)||defined(__APPLE__). On the _WIN32 path it was completely undefined. Added a fallback no-op definition in comm.h guarded by #ifndef so it applies to Windows (and any future platform that doesn't include linux_port.h). volatile int* vs volatile LONG*: Win32 Interlocked functions expect volatile LONG* (= volatile long*). The dispatcher field is volatile int. On Windows LLP64 both are 32-bit so the operation is correct, but GCC 14 promotes this mismatch from warning to error. Suppressed with -Wno-incompatible-pointer-types in Makefile.windows, consistent with how MSVC handles it silently. Co-Authored-By: Claude Sonnet 4.6 --- Makefile.windows | 2 +- comm.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.windows b/Makefile.windows index e397732..196bd01 100644 --- a/Makefile.windows +++ b/Makefile.windows @@ -21,7 +21,7 @@ CC := $(MINGW_PREFIX)-gcc AR := $(MINGW_PREFIX)-ar RANLIB := $(MINGW_PREFIX)-ranlib -CFLAGS ?= -O3 -Wno-parentheses +CFLAGS ?= -O3 -Wno-parentheses -Wno-incompatible-pointer-types LDFLAGS ?= # ── FFTW: сборка из исходников ──────────────────────────────────────────────── diff --git a/comm.h b/comm.h index f0192f8..51defd8 100644 --- a/comm.h +++ b/comm.h @@ -43,6 +43,11 @@ warren@wpratt.com #ifdef _WIN32 #include #endif + +#ifndef WDSP_FPE_GUARD +#define WDSP_FPE_GUARD ((void)0) +#define WDSP_FPE_RESTORE ((void)0) +#endif #include "fftw3.h" #include "amd.h"