Author: ed
Date: Tue Jan 17 20:21:31 2012
New Revision: 230277
URL: http://svn.freebsd.org/changeset/base/230277

Log:
  Don't expose __generic() when not using C++.
  
  According to the GCC documentation, the constructs used to implement
  <tgmath.h> are only available in C mode. They only cause breakage when
  used used with g++.
  
  Reported by:  tijl

Modified:
  head/sys/sys/cdefs.h

Modified: head/sys/sys/cdefs.h
==============================================================================
--- head/sys/sys/cdefs.h        Tue Jan 17 19:36:53 2012        (r230276)
+++ head/sys/sys/cdefs.h        Tue Jan 17 20:21:31 2012        (r230277)
@@ -260,7 +260,7 @@
 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
 #define        __generic(expr, t, yes, no)                                     
\
        _Generic(expr, t: yes, default: no)
-#elif __GNUC_PREREQ__(3, 1)
+#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
 #define        __generic(expr, t, yes, no)                                     
\
        __builtin_choose_expr(                                          \
            __builtin_types_compatible_p(__typeof(expr), t), yes, no)
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to