Commit d27cdd56 by Cezary Kulakowski

Don't use macro expressions in another macro

We use icecc to speed up compilation in our project. After this change https://swiftshader-review.googlesource.com/12308 chromium doesn't compile via icecc as __has_include(<atomic>) is never expanded to 0 or 1 on icecc host and file <atomic> is not being included. My guess is that icecc host gets partially expanded code and it's not being passed by preprocessor again so condition #if __has_include(<atomic>) (expanded from #if USE_STD_ATOMIC) is never fulfilled. Bug: chromium:783135 Change-Id: I09cf120c399a794a15dec05d6edd74c7848fc53a Reviewed-on: https://swiftshader-review.googlesource.com/13588Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarCezary Kulakowski <ckulakowski@opera.com>
parent 241f789c
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
#include <stdlib.h> #include <stdlib.h>
#if defined(__clang__) #if defined(__clang__)
#define USE_STD_ATOMIC __has_include(<atomic>) // clang has an explicit check for the availability of atomic #if __has_include(<atomic>) // clang has an explicit check for the availability of atomic
#define USE_STD_ATOMIC 1
#endif
// atomic is available in C++11 or newer, and in Visual Studio 2012 or newer // atomic is available in C++11 or newer, and in Visual Studio 2012 or newer
#elif (defined(_MSC_VER) && (_MSC_VER >= 1700)) || (__cplusplus >= 201103L) #elif (defined(_MSC_VER) && (_MSC_VER >= 1700)) || (__cplusplus >= 201103L)
#define USE_STD_ATOMIC 1 #define USE_STD_ATOMIC 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment