Make feature detection for thead local work with MSVC
This commit is contained in:
parent
e02fed2b57
commit
16f17fb9de
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
#ifndef CPP_UTILITIES_NO_THREAD_LOCAL
|
#ifndef CPP_UTILITIES_NO_THREAD_LOCAL
|
||||||
#include "../feature_detection/features.h"
|
#include "../feature_detection/features.h"
|
||||||
#else
|
#endif
|
||||||
|
|
||||||
|
#ifndef CPP_UTILITIES_THREAD_LOCAL
|
||||||
#define CPP_UTILITIES_THREAD_LOCAL
|
#define CPP_UTILITIES_THREAD_LOCAL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -226,9 +226,6 @@
|
||||||
# else
|
# else
|
||||||
# define CPP_UTILITIES_COMPILER_CXX_THREAD_LOCAL 0
|
# define CPP_UTILITIES_COMPILER_CXX_THREAD_LOCAL 0
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# else
|
|
||||||
# error Unsupported compiler
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(CPP_UTILITIES_COMPILER_CXX_THREAD_LOCAL) && CPP_UTILITIES_COMPILER_CXX_THREAD_LOCAL
|
# if defined(CPP_UTILITIES_COMPILER_CXX_THREAD_LOCAL) && CPP_UTILITIES_COMPILER_CXX_THREAD_LOCAL
|
||||||
|
@ -236,7 +233,7 @@
|
||||||
# elif CPP_UTILITIES_COMPILER_IS_GNU || CPP_UTILITIES_COMPILER_IS_Clang || CPP_UTILITIES_COMPILER_IS_AppleClang
|
# elif CPP_UTILITIES_COMPILER_IS_GNU || CPP_UTILITIES_COMPILER_IS_Clang || CPP_UTILITIES_COMPILER_IS_AppleClang
|
||||||
# define CPP_UTILITIES_THREAD_LOCAL __thread
|
# define CPP_UTILITIES_THREAD_LOCAL __thread
|
||||||
# elif CPP_UTILITIES_COMPILER_IS_MSVC
|
# elif CPP_UTILITIES_COMPILER_IS_MSVC
|
||||||
# define CPP_UTILITIES_THREAD_LOCAL __declspec(thread)
|
# define CPP_UTILITIES_THREAD_LOCAL __declspec(thread) static
|
||||||
# else
|
# else
|
||||||
// CPP_UTILITIES_THREAD_LOCAL not defined for this configuration.
|
// CPP_UTILITIES_THREAD_LOCAL not defined for this configuration.
|
||||||
# endif
|
# endif
|
||||||
|
|
Loading…
Reference in New Issue