svn commit: r253260 - head/lib/msun/src

David Chisnall theraven at FreeBSD.org
Fri Jul 12 11:03:52 UTC 2013


Author: theraven
Date: Fri Jul 12 11:03:51 2013
New Revision: 253260
URL: http://svnweb.freebsd.org/changeset/base/253260

Log:
  Fix the build with C++ where __builtin_types_compatible_p is not allowed.

Modified:
  head/lib/msun/src/math.h

Modified: head/lib/msun/src/math.h
==============================================================================
--- head/lib/msun/src/math.h	Fri Jul 12 10:07:48 2013	(r253259)
+++ head/lib/msun/src/math.h	Fri Jul 12 11:03:51 2013	(r253260)
@@ -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(                                            \


More information about the svn-src-head mailing list