macosx extern inline problem

Jay K jay.krell at cornell.edu
Tue May 25 11:38:39 CEST 2010


Marc, good point:
 
$ echo | gcc  -Wp,-dM -E - | grep APP
#define __APPLE_CC__ 5493
#define __APPLE__ 1

 
However just simply:
 
#ifdef __GNUC__
#define WHATEVER_GMP_INLINE extern __inline__
#define WHATEVER_GMP_PROTOTYPES 0
#endif
 
will presumably just work with many gcc versions, FSF, Apple, old, new.
?
 
A little less code, works more, just as well?
(Maybe put in a separate #ifdef for cygwin, since the comment implies it is needed for it?)
 
 
 - Jay


----------------------------------------
> Date: Tue, 25 May 2010 11:00:22 +0200
> From: marc.glisse at inria.fr
> To: jay.krell at cornell.edu
> CC: gmp-discuss at gmplib.org
> Subject: RE: macosx extern inline problem
>
> On Mon, 24 May 2010, Jay K wrote:
>
>>> /* Apple gcc 4.0.1 -std=gnu99 has problems, worked around here. */
>>> #if defined __GNUC_STDC_INLINE__ && defined __APPLE__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0
>
> I believe you need a somewhat more specific test to differentiate between
> the stock gcc-4.0 from gcc.gnu.org (which currently works) and the one
> provided by XCode. Maybe the value of __APPLE_CC__ is different? (I
> haven't checked if the rest of your test is correct)
>
> --
> Marc Glisse 		 	   		  


More information about the gmp-discuss mailing list