[libunwind] r266926 - unwind: unify the definition of _LIBUNWIND_SUPPORT_FRAME_APIS

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 20 15:32:29 PDT 2016


On Wed, Apr 20, 2016 at 3:31 PM, Richard Smith <richard at metafoo.co.uk>
wrote:

> On Wed, Apr 20, 2016 at 3:18 PM, Saleem Abdulrasool via cfe-commits <
> cfe-commits at lists.llvm.org> wrote:
>
>> Author: compnerd
>> Date: Wed Apr 20 17:18:47 2016
>> New Revision: 266926
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=266926&view=rev
>> Log:
>> unwind: unify the definition of _LIBUNWIND_SUPPORT_FRAME_APIS
>>
>> Unify the definition of the _LIBUNWIND_SUPPORT_FRAME_APIS macro.  This is
>> in
>> preparation to remove another instance of -Wexpansion-to-defined.  NFC.
>>
>> Modified:
>>     libunwind/trunk/src/config.h
>>
>> Modified: libunwind/trunk/src/config.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/libunwind/trunk/src/config.h?rev=266926&r1=266925&r2=266926&view=diff
>>
>> ==============================================================================
>> --- libunwind/trunk/src/config.h (original)
>> +++ libunwind/trunk/src/config.h Wed Apr 20 17:18:47 2016
>> @@ -40,8 +40,6 @@
>>    #endif
>>
>>    #define _LIBUNWIND_BUILD_SJLJ_APIS      defined(__arm__)
>> -  #define _LIBUNWIND_SUPPORT_FRAME_APIS   (defined(__i386__) || \
>> -                                           defined(__x86_64__))
>>    #define _LIBUNWIND_EXPORT
>>  __attribute__((visibility("default")))
>>    #define _LIBUNWIND_HIDDEN
>>  __attribute__((visibility("hidden")))
>>    #define _LIBUNWIND_LOG(msg, ...) fprintf(stderr, "libuwind: " msg,
>> __VA_ARGS__)
>> @@ -68,8 +66,6 @@
>>    }
>>
>>    #define _LIBUNWIND_BUILD_SJLJ_APIS      0
>> -  #define _LIBUNWIND_SUPPORT_FRAME_APIS   (defined(__i386__) || \
>> -                                           defined(__x86_64__))
>>    #define _LIBUNWIND_EXPORT
>>  __attribute__((visibility("default")))
>>    #define _LIBUNWIND_HIDDEN
>>  __attribute__((visibility("hidden")))
>>    #define _LIBUNWIND_LOG(msg, ...) fprintf(stderr, "libuwind: " msg,
>> __VA_ARGS__)
>> @@ -86,6 +82,8 @@
>>    #endif
>>  #endif
>>
>> +#define _LIBUNWIND_SUPPORT_FRAME_APIS (defined(__i386__) ||
>> defined(__x86_64__))
>>
>
> Producing a 'defined' token by macro expansion isn't required to work
> (Clang will warn on it; some compilers won't handle it as a 'defined'
> operator at all). Instead, this should be defined by
>
> #if defined(__i386) || defined(__x86_64__)
> #define _LIBUNWIND_SUPPORT_FRAME_APIS 1
> #endif
>
> or similar.
>

Ha, and your commit message clearly points out that this was a step towards
fixing this issue I described. Sorry for the noise! :)


> +
>>  #if defined(__i386__) || defined(__x86_64__) ||
>>       \
>>      (!defined(__APPLE__) && defined(__arm__)) ||
>>        \
>>      (defined(__arm64__) || defined(__aarch64__)) ||
>>       \
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160420/3ea1672f/attachment.html>


More information about the cfe-commits mailing list