From owner-svn-src-head@FreeBSD.ORG Thu Jul 11 18:52:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40148C02; Thu, 11 Jul 2013 18:52:54 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay010.isp.belgacom.be (mailrelay010.isp.belgacom.be [195.238.6.177]) by mx1.freebsd.org (Postfix) with ESMTP id 59A3B1F5E; Thu, 11 Jul 2013 18:52:53 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmIGAJid3lFR8aPm/2dsb2JhbABagwkyg1O+SoEFF3SCIwEBBSMzIgEQCw4GBAkWCwICCQMCAQIBJx4GDQEHAQGIDwildpE+j1ARB4JWgR8DkA6BLYdIkCGDEzo Received: from 230.163-241-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.241.163.230]) by relay.skynet.be with ESMTP; 11 Jul 2013 20:52:45 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.7/8.14.7) with ESMTP id r6BIqiom029168; Thu, 11 Jul 2013 20:52:45 +0200 (CEST) (envelope-from tijl@coosemans.org) Message-ID: <51DEFEF7.4080709@coosemans.org> Date: Thu, 11 Jul 2013 20:52:39 +0200 From: Tijl Coosemans User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/20130701 Thunderbird/17.0.7 MIME-Version: 1.0 To: David Chisnall Subject: Re: svn commit: r253215 - head/lib/msun/src References: <201307111741.r6BHf5gQ060844@svn.freebsd.org> In-Reply-To: <201307111741.r6BHf5gQ060844@svn.freebsd.org> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2ARPGUAAVSEBRLNCGTWEH" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jul 2013 18:52:54 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2ARPGUAAVSEBRLNCGTWEH Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2013-07-11 19:41, David Chisnall wrote: > Author: theraven > Date: Thu Jul 11 17:41:04 2013 > New Revision: 253215 > URL: http://svnweb.freebsd.org/changeset/base/253215 >=20 > Log: > Cleanups to math.h that prevent namespace conflicts with C++. > =20 > Reviewed by: bde > MFC after: 3 days >=20 > Modified: > head/lib/msun/src/math.h >=20 > Modified: head/lib/msun/src/math.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/msun/src/math.h Thu Jul 11 16:27:11 2013 (r253214) > +++ head/lib/msun/src/math.h Thu Jul 11 17:41:04 2013 (r253215) > @@ -80,27 +80,33 @@ extern const union __nan_un { > #define FP_NORMAL 0x04 > #define FP_SUBNORMAL 0x08 > #define FP_ZERO 0x10 > + > +#if __STDC_VERSION__ >=3D 201112L > +#define __fp_type_select(x, f, d, ld) _Generic((x), \ > + float: f(x), \ > + double: d(x), \ > + long double: ld(x)) GCC doesn't support _Generic yet for -std=3Dc11. > +#elif __GNUC_PREREQ__(5, 1) GCC 3.1? > +#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( = \ > + __builtin_types_compatible_p(__typeof(x), long double), ld(x), \ > + __builtin_choose_expr( \ > + __builtin_types_compatible_p(__typeof(x), double), d(x), \ > + __builtin_choose_expr( \ > + __builtin_types_compatible_p(__typeof(x), float), f(x), (void)0))) > +#else > +#define __fp_type_select(x, f, d, ld) \ > + ((sizeof(x) =3D=3D sizeof(float)) ? f(x) \ > + : (sizeof(x) =3D=3D sizeof(double)) ? d(x) \ > + : ld(x)) > +#endif > + > #define fpclassify(x) \ > - ((sizeof (x) =3D=3D sizeof (float)) ? __fpclassifyf(x) \ > - : (sizeof (x) =3D=3D sizeof (double)) ? __fpclassifyd(x) \ > - : __fpclassifyl(x)) > - > -#define isfinite(x) \ > - ((sizeof (x) =3D=3D sizeof (float)) ? __isfinitef(x) \ > - : (sizeof (x) =3D=3D sizeof (double)) ? __isfinite(x) \ > - : __isfinitel(x)) > -#define isinf(x) \ > - ((sizeof (x) =3D=3D sizeof (float)) ? __isinff(x) \ > - : (sizeof (x) =3D=3D sizeof (double)) ? isinf(x) \ > - : __isinfl(x)) > -#define isnan(x) \ > - ((sizeof (x) =3D=3D sizeof (float)) ? __isnanf(x) \ > - : (sizeof (x) =3D=3D sizeof (double)) ? isnan(x) \ > - : __isnanl(x)) > -#define isnormal(x) \ > - ((sizeof (x) =3D=3D sizeof (float)) ? __isnormalf(x) \ > - : (sizeof (x) =3D=3D sizeof (double)) ? __isnormal(x) \ > - : __isnormall(x)) > + __fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyd) Last __fpclassifyd should be __fpclassifyl. > @@ -227,8 +250,6 @@ double expm1(double); > double fma(double, double, double); > double hypot(double, double); > int ilogb(double) __pure2; > -int (isinf)(double) __pure2; > -int (isnan)(double) __pure2; I think they should stay for the C90 case. ------enig2ARPGUAAVSEBRLNCGTWEH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlHe/vwACgkQfoCS2CCgtiv3QwD/USQ3ZRmBJDOZVM/rLceqnkT3 RdTlc2V1NOw0jIiQuQgA/1fZCdFTdAlEmewAxjjPNQDf2iKMBS1Hyu69iBPBszPG =NRg+ -----END PGP SIGNATURE----- ------enig2ARPGUAAVSEBRLNCGTWEH--