summaryrefslogtreecommitdiffstats
path: root/lib/msun
diff options
context:
space:
mode:
authortheraven <theraven@FreeBSD.org>2013-07-12 11:03:51 +0000
committertheraven <theraven@FreeBSD.org>2013-07-12 11:03:51 +0000
commit7804a995aae45b8567b56468471e25b9bfa385e6 (patch)
tree76ce6c3ed42224f109c368541f727e9777ff23aa /lib/msun
parent0c980c204a2fd741eedef4c0ff6ad99e0395bb29 (diff)
downloadFreeBSD-src-7804a995aae45b8567b56468471e25b9bfa385e6.zip
FreeBSD-src-7804a995aae45b8567b56468471e25b9bfa385e6.tar.gz
Fix the build with C++ where __builtin_types_compatible_p is not allowed.
Diffstat (limited to 'lib/msun')
-rw-r--r--lib/msun/src/math.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h
index 766a36c..14073cb 100644
--- a/lib/msun/src/math.h
+++ b/lib/msun/src/math.h
@@ -81,12 +81,13 @@ extern const union __nan_un {
#define FP_SUBNORMAL 0x08
#define FP_ZERO 0x10
-#if __STDC_VERSION__ >= 201112L && defined(__clang__)
+#if (__STDC_VERSION__ >= 201112L && defined(__clang__)) || \
+ __has_extension(c_generic_selections)
#define __fp_type_select(x, f, d, ld) _Generic((x), \
float: f(x), \
double: d(x), \
long double: ld(x))
-#elif __GNUC_PREREQ__(3, 1)
+#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \
__builtin_types_compatible_p(__typeof(x), long double), ld(x), \
__builtin_choose_expr( \
OpenPOWER on IntegriCloud