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 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__

Wouldn't a disjunctive form be easier to read?  E.g.
#if (!defined __cplusplus && defined __GNUC__) || __GNUC_PREREQ (4,3)


-- 
ldv

Attachment: pgp00000.pgp
Description: PGP signature


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