summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcxx/include/math.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxx/include/math.h b/libcxx/include/math.h
index 194df2077bb..c9b4733e9c4 100644
--- a/libcxx/include/math.h
+++ b/libcxx/include/math.h
@@ -510,7 +510,11 @@ _LIBCPP_INLINE_VISIBILITY
bool
__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
{
+#if __has_builtin(__builtin_isnan)
+ return __builtin_isnan(__lcpp_x);
+#else
return isnan(__lcpp_x);
+#endif
}
#undef isnan
OpenPOWER on IntegriCloud