Make sure __has_builtin is defined

This commit is contained in:
mikeoliphant
2023-04-05 12:29:30 -07:00
parent 022888bc6e
commit 253a705243
+5
View File
@@ -3,6 +3,9 @@
#ifndef ARCHITECTURE_HPP
#define ARCHITECTURE_HPP
#include <cfenv>
#include <fenv.h>
// check cpu architecture
#if /* x86_64 */ \
@@ -92,9 +95,11 @@ inline void disable_denormals() noexcept {
_mm_setcsr(_mm_getcsr() | 0x8040);
#endif
#elif defined(ARCH_ARM)
#if defined __has_builtin
#if __has_builtin(__builtin_arm_set_fpscr) && __has_builtin(__builtin_arm_get_fpscr)
__builtin_arm_set_fpscr(__builtin_arm_get_fpscr() | (1 << 24));
#endif
#endif
#endif
}