This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use __gnu_inline__ for __extern_always_inline in g++-4.2
Ping.
On Wed, Jan 16, 2013 at 4:29 PM, Richard Smith <richard@metafoo.co.uk> wrote:
> On Wed, Jan 16, 2013 at 4:15 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> That looks OK to me but it needs a proper ChangeLog entry.
>
> diff --git a/ChangeLog b/ChangeLog
> index 248e8df..31ea7c4 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,9 @@
> +2013-01-16 Richard Smith <richard@metafoo.co.uk>
> +
> + * misc/sys/cdefs.h (__extern_inline, __extern_always_inline):
> + Remove GCC version check, request GNU inline semantics whenever
> + the compiler supports the __gnu_inline__ attribute.
> +
> 2013-01-16 Andreas Schwab <schwab@suse.de>
>
> [BZ #14327]
> diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
> index 717bb7b..a49f413 100644
> --- a/misc/sys/cdefs.h
> +++ b/misc/sys/cdefs.h
> @@ -317,10 +317,12 @@
> # define __attribute_artificial__ /* Ignore */
> #endif
>
> -/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
> - inline semantics, unless -fgnu89-inline is used. */
> -#if (!defined __cplusplus || __GNUC_PREREQ (4,3)) && defined __GNUC__
> -# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
> +#ifdef __GNUC__
> +/* One of these will be defined if the __gnu_inline__ attribute is
> + available. In C++, __GNUC_GNU_INLINE__ will be defined even though
> + __inline does not use the GNU inlining rules. If neither macro is
> + defined, this version of GCC only supports GNU inline semantics. */
> +# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
> # define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
> # define __extern_always_inline \
> extern __always_inline __attribute__ ((__gnu_inline__))
> @@ -328,10 +330,6 @@
> # define __extern_inline extern __inline
> # define __extern_always_inline extern __always_inline
> # endif
> -#elif defined __GNUC__ /* C++ and GCC <4.3. */
> -# define __extern_inline extern __inline
> -# define __extern_always_inline \
> - extern __always_inline
> #else /* Not GCC. */
> # define __extern_inline /* Ignore */
> # define __extern_always_inline /* Ignore */