This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to handle c99 inline changes? [was RE: -fkeep-inline-functions and broken Cygwin bootstrap (was: Building GCC 4.3.0 on Cygwin...)]
"Dave Korn" <dave.korn@artimi.com> writes:
> 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?
Yes, good point.
Ian