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]

[PATCH] Fix up definitions for older G++


So this should fix both bugs #14530 and #13741.  We weren't defining
__extern_always_inline macro for C++ when using G++ earlier than 4.3,
which caused failures.  This still not addresses non-GCC compilers,
though
BTW, wonder whether in that macro shouldn't be __GNUC_GNU_INLINE__
in place of __GNUC_STDC_INLINE__.  We have:
# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
#  define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
#  define __extern_always_inline \
  extern __always_inline __attribute__ ((__gnu_inline__))
That way, when using -fgnu89-inline the __GNUC_GNU_INLINE__ would be
defined and we'd get the gnu_inline attribute.

Tried to compile <stdlib.h> with gcc 4[1234567]/trunk.  Tested x86_64,
ok for trunk?

2012-08-31  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.

--- libc/misc/sys/cdefs.h.mp2	2012-08-31 11:52:24.778971804 +0200
+++ libc/misc/sys/cdefs.h	2012-08-31 13:20:30.430284130 +0200
@@ -329,6 +329,10 @@
 #  define __extern_inline extern __inline
 #  define __extern_always_inline extern __always_inline
 # endif
+#else /* C++ and GCC <4.3.  */
+# define __extern_inline extern __inline
+# define __extern_always_inline \
+  extern __always_inline
 #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]