Date: Mon, 27 May 2013 17:26:06 +0200 From: Tijl Coosemans <tijl@coosemans.org> To: David Schultz <das@FreeBSD.ORG> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ed Schouten <ed@FreeBSD.org> Subject: Re: svn commit: r250990 - head/include Message-ID: <51A37B0E.1010807@coosemans.org> In-Reply-To: <20130527083441.GA1309@zim.MIT.EDU> References: <201305251855.r4PIttB7052695@svn.freebsd.org> <20130527083441.GA1309@zim.MIT.EDU>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On 2013-05-27 10:34, David Schultz wrote: > On Sat, May 25, 2013, Ed Schouten wrote: >> Author: ed >> Date: Sat May 25 18:55:55 2013 >> New Revision: 250990 >> URL: http://svnweb.freebsd.org/changeset/base/250990 >> >> Log: >> Add C11 macros CMPLX(), CMPLXF() and CMPLXL(). >> >> Clang allows us to initialize complex numbers using an array >> initializer, casted to a complex type. GCC has a builtin called >> __builtin_complex(). > > Awesome, thanks! I recall that we talked about this last year, and > the blocking issue was that gcc didn't support it. It appears > that the one in the base system still doesn't, but now that clang > is the default compiler, maybe that doesn't matter. > > There are some regression tests in tools/regression/lib/msun that > could be converted to exercise these macros if you wish: grep for > "cpack". You could add a cpack-like fall-back for old gcc. It's not usable for static initialisation, but maybe it's better than nothing. #define CMPLX(x, y) __extension__({ double complex __z; \ __real__ __z = (x); __imag__ __z = (y); __z; }) [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iF4EAREIAAYFAlGjexMACgkQfoCS2CCgtiuFwgD/bV7CvQcPpjpbgBmxw6MD9FWX D9O/H4h+xXxctU/nZgsA/jIeUD+RK+IR5UrEURH0BP02wFrMacxKGFuDvYdtv0m3 =K80O -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51A37B0E.1010807>
