1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

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:
Yuxuan Shui 2018-11-03 14:02:58 +00:00
parent be09a9a835
commit f65d7b2e64

View file

@ -4,6 +4,7 @@
#include <ctype.h> #include <ctype.h>
#include <stddef.h> #include <stddef.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h>
#include <math.h> #include <math.h>
#ifdef __FAST_MATH__ #ifdef __FAST_MATH__
@ -11,7 +12,11 @@
therefore it is not recommended. therefore it is not recommended.
#endif #endif
#ifdef __clang__
__attribute__((optnone))
#else
__attribute__((optimize("-fno-fast-math"))) __attribute__((optimize("-fno-fast-math")))
#endif
static inline bool safe_isnan(double a) { static inline bool safe_isnan(double a) {
return isnan(a); return isnan(a);
} }