Fix unsupported optimize attribute on clang
Use optnone instead, this does require a more recent clang though. In general, just don't use -ffast-math. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
be09a9a835
commit
f65d7b2e64
|
@ -4,6 +4,7 @@
|
|||
#include <ctype.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef __FAST_MATH__
|
||||
|
@ -11,7 +12,11 @@
|
|||
therefore it is not recommended.
|
||||
#endif
|
||||
|
||||
#ifdef __clang__
|
||||
__attribute__((optnone))
|
||||
#else
|
||||
__attribute__((optimize("-fno-fast-math")))
|
||||
#endif
|
||||
static inline bool safe_isnan(double a) {
|
||||
return isnan(a);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue