From 020b782474240e4de4f908c1074c500dfac043a2 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 7 Nov 2020 00:20:55 +0000 Subject: [PATCH] LibJS: Use pow instead of __bulitin_pow on clang __bulitin_pow doesn't seem to exist on clang, at least it didn't build with it. --- Libraries/LibJS/Runtime/NumberConstructor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Libraries/LibJS/Runtime/NumberConstructor.cpp b/Libraries/LibJS/Runtime/NumberConstructor.cpp index 6453fd840e..c95441166e 100644 --- a/Libraries/LibJS/Runtime/NumberConstructor.cpp +++ b/Libraries/LibJS/Runtime/NumberConstructor.cpp @@ -30,9 +30,15 @@ #include #include +#ifdef __clang__ +# define EPSILON_VALUE pow(2, -52) +# define MAX_SAFE_INTEGER_VALUE pow(2, 53) - 1 +# define MIN_SAFE_INTEGER_VALUE -(pow(2, 53) - 1) +#else constexpr const double EPSILON_VALUE { __builtin_pow(2, -52) }; constexpr const double MAX_SAFE_INTEGER_VALUE { __builtin_pow(2, 53) - 1 }; constexpr const double MIN_SAFE_INTEGER_VALUE { -(__builtin_pow(2, 53) - 1) }; +#endif namespace JS {