summaryrefslogtreecommitdiffstats
path: root/sys/sys/cdefs.h
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-06-27 15:13:14 +0000
committerpfg <pfg@FreeBSD.org>2015-06-27 15:13:14 +0000
commitc299fa4b882f43f340b0bb0f5b0aad1b74a5159c (patch)
tree2de8f71553f7e29715113e8091facd2ef6be9651 /sys/sys/cdefs.h
parent69a4e9c7040829950bf88b444250cc269e1484b6 (diff)
downloadFreeBSD-src-c299fa4b882f43f340b0bb0f5b0aad1b74a5159c.zip
FreeBSD-src-c299fa4b882f43f340b0bb0f5b0aad1b74a5159c.tar.gz
Change detection for the gnu_inline attribute.
According to the GCC documentation: "This attribute is available in GCC 4.1.3 and later. It is available if either of the preprocessor macros __GNUC_GNU_INLINE__ or __GNUC_STDC_INLINE__ are defined." We don't keep the gcc granularity up to the minor number so it's better to use the documented way. Current clang defines both macros. Reference: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#Common-Function-Attributes
Diffstat (limited to 'sys/sys/cdefs.h')
-rw-r--r--sys/sys/cdefs.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index cfd68e9..23e567c 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -542,7 +542,7 @@
* using these but GCC-compatible compilers tend to support the extensions
* well enough to use them in limited cases.
*/
-#if __GNUC_PREREQ__(4, 1)
+#if defined(__GNUC_GNU_INLINE__) || defined(__GNUC_STDC_INLINE__)
#if __has_attribute(artificial) || __GNUC_PREREQ__(4, 3)
#define __gnu_inline __attribute__((__gnu_inline__, __artificial__))
#else
OpenPOWER on IntegriCloud