Refuse to build with -ffast-math on Apple Clang 16.0.0

This commit is contained in:
Geraint 2025-01-20 17:56:56 +00:00
parent f057f06156
commit e2cee68d6c

View File

@ -1,6 +1,10 @@
#ifndef SIGNALSMITH_DSP_COMMON_H #ifndef SIGNALSMITH_DSP_COMMON_H
#define SIGNALSMITH_DSP_COMMON_H #define SIGNALSMITH_DSP_COMMON_H
#if defined(__FAST_MATH__) && (__apple_build_version__ >= 16000000) && (__apple_build_version__ <= 16000099)
# error Apple Clang 16.0.0 is broken, and generates completely incorrect code for some SIMD operations. -ffast-math makes it worse, so if you HAVE to use this version of Clang, you can't enable -ffast-math.
#endif
#ifndef M_PI #ifndef M_PI
#define M_PI 3.14159265358979323846264338327950288 #define M_PI 3.14159265358979323846264338327950288
#endif #endif