summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2014-09-03 09:35:38 +0000
committered <ed@FreeBSD.org>2014-09-03 09:35:38 +0000
commitdffba5b7eb5d7c0142bcdd24b417ed4d86754fde (patch)
tree129180b85ca5a890a049968a537a008b2d555cf1 /include
parentf6ccc75aa84df055b49d14ac631bd080921d765e (diff)
downloadFreeBSD-src-dffba5b7eb5d7c0142bcdd24b417ed4d86754fde.zip
FreeBSD-src-dffba5b7eb5d7c0142bcdd24b417ed4d86754fde.tar.gz
Leave the C11 keywords alone when we have a recent version of GCC.
As GCC also gained support for the C11 keywords over time, we can patch up <sys/cdefs.h> to not define these anymore. This has the advantage that error messages for static assertions are printed natively and that _Alignas() will work with even a type outside of C11 mode. All C11 keywords are supported with GCC 4.7 and higher, with the exception of _Thread_local and _Generic. These are only supported as of GCC 4.9.
Diffstat (limited to 'include')
-rw-r--r--include/tgmath.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/tgmath.h b/include/tgmath.h
index 7f4de6f..488575f 100644
--- a/include/tgmath.h
+++ b/include/tgmath.h
@@ -61,7 +61,7 @@
*/
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
- __has_extension(c_generic_selections)
+ __has_extension(c_generic_selections) || __GNUC_PREREQ__(4, 9)
#define __tg_generic(x, cfnl, cfn, cfnf, fnl, fn, fnf) \
_Generic(x, \
long double _Complex: cfnl, \
OpenPOWER on IntegriCloud