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
This commit is contained in:
Pedro F. Giffuni 2015-06-27 15:13:14 +00:00
parent de3587025a
commit 49a740381e

View File

@ -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