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
- From: Richard Smith <richard at metafoo dot co dot uk>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org, Andreas Schwab <schwab at suse dot de>, Paul Eggert <eggert at cs dot ucla dot edu>
- Date: Thu, 31 Jan 2013 16:15:49 -0800
- Subject: Re: [PATCH] Use __gnu_inline__ for __extern_always_inline in g++-4.2
- References: <CAGL0aWcOzkWXRBC_V7NJq9W4qcaqAzjXNKhYxmc2D9+s_6Au8w@mail.gmail.com><CAGL0aWeEx=m5LWByJVpz0psp-kW7m=zYs+uf_o5w7PX9F3BT4w@mail.gmail.com><CAGL0aWe0DcKOyRD1seGX+Ge9xQtrMdG3Wzf-CRQt11U_HZvFrA@mail.gmail.com><CAGL0aWfWizZNKFa9idTQZRyf8MLB9SLkqnRgn8uv14HiPduRZw@mail.gmail.com><mvmehhwrqfm.fsf@hawking.suse.de><CAOfiQq=aU1pU6sNWKFJMpfh2z3EjVoyWjWe0XXEP6-QpPwCa7A@mail.gmail.com><CAOfiQq=t6UMnZibtsi3kVsCatBGoyG=Aq=++Pb-f3t1h3zG0mQ@mail.gmail.com><20130116234849.160E22C0CC@topped-with-meat.com><CAOfiQq=weXJm9wicibfsK+d_PqnTaZ2xL8KMzMyomu4mMyeeyg@mail.gmail.com><20130117001544.4D24C2C0A8@topped-with-meat.com><CAOfiQqnVEi91=91sL7KpeW6_g1ktOXp7y48oLspFSrcN84=zXQ@mail.gmail.com><20130131181808.0A5912C066@topped-with-meat.com>
On Thu, Jan 31, 2013 at 10:18 AM, Roland McGrath <roland@hack.frob.com> wrote:
> Please see the wiki contribution checklist about how to post log entries
> with patches properly.
>
> A log entry changing #if conditions needs to mention explicitly the symbols
> being tested, not just describe the change in the abstract.
Thank you, I hope this is what you had in mind.
2013-01-31 Richard Smith <richard@metafoo.co.uk>
* misc/sys/cdefs.h (__extern_inline, __extern_always_inline)
[__GNUC__ && (__GNUC_STDC_INLINE__ || __GNUC_GNU_INLINE__)]:
Use __attribute__ ((__gnu_inline__)).
[__GNUC__ && !(__GNUC_STDC_INLINE__ || __GNUC_GNU_INLINE__)]:
Don't use __attribute__ ((__gnu_inline__)).
--- 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 */