aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/math.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/math/math.h b/math/math.h
index e21708045a..dea8dbe1ae 100644
--- a/math/math.h
+++ b/math/math.h
@@ -442,8 +442,12 @@ enum
/* Return nonzero value if X is positive or negative infinity. */
# if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
- && !defined __SUPPORT_SNAN__
- /* __builtin_isinf_sign is broken for float128 only before GCC 7.0. */
+ && !defined __SUPPORT_SNAN__ && !defined __cplusplus
+ /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0,
+ use the helper function, __isinff128, with older compilers. This is
+ only provided for C mode, because in C++ mode, GCC has no support
+ for __builtin_types_compatible_p (and when in C++ mode, this macro is
+ not used anyway, because libstdc++ headers undefine it). */
# define isinf(x) \
(__builtin_types_compatible_p (__typeof (x), _Float128) \
? __isinff128 (x) : __builtin_isinf_sign (x))