Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jan 2012 20:21:31 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230277 - head/sys/sys
Message-ID:  <201201172021.q0HKLVQW006008@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201172021.q0HKLVQW006008>