[Mesa-dev] [PATCH v2] util: remove redundant check for the __clang__ macro

Vlad Golovkin vlad.golovkin.mail at gmail.com
Tue Feb 6 17:50:40 UTC 2018


2018-02-06 17:19 GMT+02:00 Brian Paul <brianp at vmware.com>:
> On 02/06/2018 06:48 AM, Vlad Golovkin wrote:
>>
>> Clang defines __GNUC__ macro, so one doesn't need to check __clang__
>> macro in this particular case.
>>
>> v2: added comment as per Brian Paul's suggestion
>> ---
>>   src/util/macros.h | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/util/macros.h b/src/util/macros.h
>> index 432d513930..e3c785af50 100644
>> --- a/src/util/macros.h
>> +++ b/src/util/macros.h
>> @@ -137,8 +137,9 @@ do {                       \
>>   #endif
>>     /* Forced function inlining */
>> +/* Note: Clang also sets __GNUC__ (see other cases below) */
>>   #ifndef ALWAYS_INLINE
>> -#  if defined(__GNUC__) || defined(__clang__)
>> +#  if defined(__GNUC__)
>>   #    define ALWAYS_INLINE inline __attribute__((always_inline))
>>   #  elif defined(_MSC_VER)
>>   #    define ALWAYS_INLINE __forceinline
>>
>
> Thanks!
>
> Reviewed-by: Brian Paul <brianp at vmware.com>
>
> Do you need me to push this for you?


I don't have push access, so that would be great.

Thanks.


More information about the mesa-dev mailing list