Workaround compiling with -ffast-math
And add a compiler warning. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
11
src/utils.h
11
src/utils.h
@ -4,6 +4,17 @@
|
||||
#include <ctype.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifdef __FAST_MATH__
|
||||
#warning Use of -ffast-math can cause rendering error or artifacts, \
|
||||
therefore it is not recommended.
|
||||
#endif
|
||||
|
||||
__attribute__((optimize("-fno-fast-math")))
|
||||
static inline bool safe_isnan(double a) {
|
||||
return isnan(a);
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize an int value to a specific range.
|
||||
|
Reference in New Issue
Block a user