From d1123c03bdb1fe6276815aa8d5f2549f0eca7c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E6=99=93=E4=BC=9F?= <39303645+Shixiaowei02@users.noreply.github.com> Date: Wed, 23 Sep 2020 14:41:29 +0800 Subject: [PATCH] [windows]win32 thread-local support, test=develop (#4401) --- lite/utils/macros.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lite/utils/macros.h b/lite/utils/macros.h index 5c2f85e92c..632a99627a 100644 --- a/lite/utils/macros.h +++ b/lite/utils/macros.h @@ -59,8 +59,11 @@ // Thread local storage will be ignored because the linker for iOS 8 does not // support it. #define LITE_THREAD_LOCAL -#elif __cplusplus >= 201103 +#elif defined(__cplusplus) && (__cplusplus >= 201103) +#define LITE_THREAD_LOCAL thread_local +#elif defined(_WIN32) +// The MSVC compiler does not support standards switches for C++11. #define LITE_THREAD_LOCAL thread_local #else -#error "C++11 support is required for paddle-lite compilation." +#error "[Paddle-Lite] C++11 support is required for paddle-lite compilation." #endif -- GitLab