diff options
| author | 2018-04-20 09:43:52 -0400 | |
|---|---|---|
| committer | 2018-04-20 09:43:52 -0400 | |
| commit | 4d96997447cad9d236770f930f61d2ed298baeff (patch) | |
| tree | 2bcccecc58a11b4c5f3f10098e93bbe6292f5b25 | |
| parent | Merge pull request #362 from lioncash/snprintf (diff) | |
| parent | common/thread: Remove unnecessary feature checking for thread_local (diff) | |
| download | yuzu-4d96997447cad9d236770f930f61d2ed298baeff.tar.gz yuzu-4d96997447cad9d236770f930f61d2ed298baeff.tar.xz yuzu-4d96997447cad9d236770f930f61d2ed298baeff.zip | |
Merge pull request #364 from lioncash/thread-local
common/thread: Remove unnecessary feature checking for thread_local
| -rw-r--r-- | src/common/thread.h | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/common/thread.h b/src/common/thread.h index fa475ab51..9465e1de7 100644 --- a/src/common/thread.h +++ b/src/common/thread.h | |||
| @@ -11,25 +11,6 @@ | |||
| 11 | #include <thread> | 11 | #include <thread> |
| 12 | #include "common/common_types.h" | 12 | #include "common/common_types.h" |
| 13 | 13 | ||
| 14 | // Support for C++11's thread_local keyword was surprisingly spotty in compilers until very | ||
| 15 | // recently. Fortunately, thread local variables have been well supported for compilers for a while, | ||
| 16 | // but with semantics supporting only POD types, so we can use a few defines to get some amount of | ||
| 17 | // backwards compat support. | ||
| 18 | // WARNING: This only works correctly with POD types. | ||
| 19 | #if defined(__clang__) | ||
| 20 | #if !__has_feature(cxx_thread_local) | ||
| 21 | #define thread_local __thread | ||
| 22 | #endif | ||
| 23 | #elif defined(__GNUC__) | ||
| 24 | #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8) | ||
| 25 | #define thread_local __thread | ||
| 26 | #endif | ||
| 27 | #elif defined(_MSC_VER) | ||
| 28 | #if _MSC_VER < 1900 | ||
| 29 | #define thread_local __declspec(thread) | ||
| 30 | #endif | ||
| 31 | #endif | ||
| 32 | |||
| 33 | namespace Common { | 14 | namespace Common { |
| 34 | 15 | ||
| 35 | int CurrentThreadId(); | 16 | int CurrentThreadId(); |