This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix up definitions for older G++


On Thu, Sep 06, 2012 at 09:52:22AM +0200, Andreas Jaeger wrote:
> I guess that's the best alternative for now,

Like this?  It's unfortunately more hairy than it should be :(.
Tested x86_64 and tried with gcc 4.[123]/trunk.

2012-09-08  Marek Polacek  <polacek@redhat.com>

	[BZ #14530]
	[BZ #13741]
	* misc/sys/cdefs.h: Define __extern_inline and __extern_always_inline
	for C++ and GCC <4.3 as well as for non GCC compilers.

--- libc/misc/sys/cdefs.h.mp2	2012-08-31 11:52:24.778971804 +0200
+++ libc/misc/sys/cdefs.h	2012-09-08 12:00:10.322502382 +0200
@@ -320,7 +320,7 @@
 
 /* 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)
+#if (!defined __cplusplus || __GNUC_PREREQ (4,3)) && defined __GNUC__
 # if defined __GNUC_STDC_INLINE__ || defined __cplusplus
 #  define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
 #  define __extern_always_inline \
@@ -329,6 +329,13 @@
 #  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 */
 #endif
 
 /* GCC 4.3 and above allow passing all anonymous arguments of an

	Marek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]