On 28 March 2007 15:14, Ian Lance Taylor wrote: > It's simpler than that. I defined new preprocessor macros > specifically to avoid this complexity. Here is one approach that > should work; > > #ifdef __GNUC_STDC_INLINE__ > #define ELIDABLE_INLINE inline > #else > #define ELIDABLE_INLINE extern inline > #endif > > Ian
To allow for non gcc compilers, I think I should in fact say #if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__) #define ELIDABLE_INLINE extern inline #else #define ELIDABLE_INLINE inline #endif ... i.e., if using gcc without the new behaviour, use the old 'extern inline' definition, otherwise we're either not using gcc or using gcc with the new behaviour, so just use 'inline', which will work if we're gcc, and is just the-best-we-can-do-and-hope-it-works for non-gcc compilers (to which 'extern inline' means either nothing at all, or means "emit the function body as per c99". Does that look sensible to you? cheers, DaveK -- Can't think of a witty .sigline today....