Boost logo

Boost :

Subject: Re: [boost] [config] BOOST_FORCEINLINE for clang
From: Michel Morin (mimomorin_at_[hidden])
Date: 2013-05-14 11:11:29


Daryle Walker wrote:
> > Committed in r84245 ( https://svn.boost.org/trac/boost/changeset/84245 ):
> > --- boost/config/suffix.hpp (revision 84244)
> > +++ boost/config/suffix.hpp (working copy)
> > @@ -641,7 +641,7 @@
> > # if defined(_MSC_VER)
> > # define BOOST_FORCEINLINE __forceinline
> > # elif defined(__GNUC__) && __GNUC__ > 3
> > -# define BOOST_FORCEINLINE inline __attribute__ ((always_inline))
> > +# define BOOST_FORCEINLINE inline __attribute__ ((__always_inline__))
> > # else
> > # define BOOST_FORCEINLINE inline
> > # endif
>
> You should include a comment in the GCC section that it also works for Clang,
> due to Clang's GCC emulation. That way, later maintainers won't be wondering
> if Clang support should be added. (And help debugging if Clang ever stops
> emulating GCC by default.)

What about doing it in a more explicit way (though redundant)?
i.e. change
  # elif defined(__GNUC__) && __GNUC__ > 3
to
  # elif (defined(__GNUC__) && __GNUC__ > 3) || defined(BOOST_CLANG)

Regards,
Michel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk