Boost logo

Boost :

Subject: Re: [boost] [config] BOOST_FORCEINLINE for clang
From: Krzysztof Czainski (1czajnik_at_[hidden])
Date: 2013-05-12 06:38:33


2013/5/12 Vicente J. Botet Escriba <vicente.botet_at_[hidden]>

> Hi,
>
> I would like to add the definition of BOOST_FORCEINLINE for clang when
> __has_attribute(always_inline)
>

Hi,

Please consider, what if __has_attribute(always_inline) is false in clang.
By just reading the below, I think BOOST_FORCEINLINE won't be defined at
all in that case. Shouldn't it be defined to something like plain old
'inline'?

HTH, Kris

> // BOOST_FORCEINLINE ------------------------------**---------------//
> #if !defined(BOOST_FORCEINLINE)
> # if defined(_MSC_VER)
> # define BOOST_FORCEINLINE __forceinline
> +# elif defined(__clang__)
> +# if __has_attribute(always_inline)
> +# define BOOST_FORCEINLINE inline __attribute__((always_inline))
> +# endif
> # elif defined(__GNUC__) && __GNUC__ > 3
> # define BOOST_FORCEINLINE inline __attribute__ ((always_inline))
> # else
>
> Could I commit it?
>

> Best,
> Vicente
>


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