Date: Sat, 27 Apr 2013 21:18:35 +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: r249995 - head/include Message-ID: <201304272118.r3RLIZa0069702@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Sat Apr 27 21:18:34 2013 New Revision: 249995 URL: http://svnweb.freebsd.org/changeset/base/249995 Log: Enable improved <tgmath.h> for Clang even when not using C11. By using __has_extension(c_generic_selections), we can explicitly test whether we're dealing with a version of Clang that supports _Generic(). That way we can use the improved <tgmath.h> code, even when not using -std=c11. This massively reduces the compilation time when invoking these functions. Modified: head/include/tgmath.h Modified: head/include/tgmath.h ============================================================================== --- head/include/tgmath.h Sat Apr 27 20:24:30 2013 (r249994) +++ head/include/tgmath.h Sat Apr 27 21:18:34 2013 (r249995) @@ -60,7 +60,8 @@ * compilers use an inefficient yet reliable version. */ -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ + __has_extension(c_generic_selections) #define __tg_generic(x, cfnl, cfn, cfnf, fnl, fn, fnf) \ _Generic(x, \ long double _Complex: cfnl, \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201304272118.r3RLIZa0069702>