[PATCH] Fix up definitions for older G++

Andreas Jaeger aj@suse.com
Mon Sep 24 15:34:00 GMT 2012


On 09/20/2012 04:27 AM, Marek Polacek wrote:
> Ping.

Yes, this is fine,

thanks,
Andreas

> On Sat, Sep 08, 2012 at 01:25:01PM +0200, Marek Polacek wrote:
>> 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
>


-- 
  Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
   SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
    GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
     GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126



More information about the Libc-alpha mailing list