From fb85cda187a33dd17e37e9dc5d72a5ab613338e2 Mon Sep 17 00:00:00 2001 From: Ethan Bass Date: Sat, 24 Oct 2026 00:39:19 -0500 Subject: [PATCH] Restrict macOS feenableexcept polyfill to x86_64 The polyfill reads fenv_t's __control and __mxcsr fields, which exist only on Intel. On Apple Silicon fenv_t has __fpcr/__fpsr instead, so debug.cpp fails to compile. The callers are already guarded by __x86_64__, so the polyfill is unused on arm64. Fixes #287 --- src/debug.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug.cpp b/src/debug.cpp index b26e173c..e3d5cb3d 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -94,7 +94,7 @@ You can disable floating point tests with the -no-check switch (use at your own this is an Intel hardware feature that does not slow down computations. */ -#if defined(__APPLE__) && defined(__MACH__) +#if defined(__APPLE__) && defined(__MACH__) && defined(__x86_64__) // Public domain polyfill for feenableexcept on OS X // http://www-personal.umich.edu/~williams/archive/computation/fe-handling-example.c