Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Apr 2012 18:19:53 +0100
From:      David Chisnall <theraven@FreeBSD.ORG>
To:        David Schultz <das@FreeBSD.ORG>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, Kirk McKusick <mckusick@FreeBSD.ORG>
Subject:   Re: svn commit: r232351 - in head/sys: kern sys ufs/ffs ufs/ufs
Message-ID:  <44678A07-0CDB-40E5-A149-DFE55FB96611@FreeBSD.ORG>
In-Reply-To: <20120407171022.GB2737@zim.MIT.EDU>
References:  <201203011845.q21IjQqt091350@svn.freebsd.org> <20120302125334.GH75778@deviant.kiev.zoral.com.ua> <0F23DDD1-1CAC-4E72-A3CB-56B81F0C0790@FreeBSD.org> <20120407171022.GB2737@zim.MIT.EDU>

next in thread | previous in thread | raw e-mail | index | archive | help
On 7 Apr 2012, at 18:10, David Schultz wrote:

> The biggest hinderance to using extern inline is that gcc and C99
> disagree about what it means, unless you use a reasonably recent
> compiler in C99 mode.  I first tried to use extern inline in the
> tree several years after I backported gcc's C99 inline support,
> and it still turned out to be a headache.

You can detect which inlining mode is going to happen by checking the =
value of __STDC_VERSION__ and the value of __GNUC_GNU_INLINE__.  If =
__STDC_VERSION__ is >=3D 199901L and __GNUC_GNU_INLINE__ is not defined =
then you're in C99 inlining mode, otherwise you're in GNU inlining mode. =
=20

On some projects with headers that need to work in both modes, we've =
written some INLINE_EXTERN macros that do the right thing in whichever =
mode we find ourselves compiling.  It might be worth putting these in =
cdefs.h if they're generally useful.

David=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44678A07-0CDB-40E5-A149-DFE55FB96611>