diff --git a/include/Nazara/Prerequesites.hpp b/include/Nazara/Prerequesites.hpp index 0b16e4de9..b38528c6b 100644 --- a/include/Nazara/Prerequesites.hpp +++ b/include/Nazara/Prerequesites.hpp @@ -36,22 +36,18 @@ #include ///TODO: Rajouter des tests d'identification de compilateurs -// NAZARA_THREADLOCAL n'existe qu'en attendant le support complet de thread_local #if defined(__BORLANDC__) #define NAZARA_COMPILER_BORDLAND #define NAZARA_DEPRECATED(txt) #define NAZARA_FUNCTION __FUNC__ - #define NAZARA_THREADLOCAL __declspec(thread) #elif defined(__clang__) #define NAZARA_COMPILER_CLANG #define NAZARA_DEPRECATED(txt) __attribute__((__deprecated__(txt))) #define NAZARA_FUNCTION __PRETTY_FUNCTION__ - #define NAZARA_THREADLOCAL __declspec(thread) #elif defined(__GNUC__) || defined(__MINGW32__) #define NAZARA_COMPILER_GCC #define NAZARA_DEPRECATED(txt) __attribute__((__deprecated__(txt))) #define NAZARA_FUNCTION __PRETTY_FUNCTION__ - #define NAZARA_THREADLOCAL __thread #ifdef __MINGW32__ #define NAZARA_COMPILER_MINGW @@ -63,17 +59,14 @@ #define NAZARA_COMPILER_INTEL #define NAZARA_DEPRECATED(txt) #define NAZARA_FUNCTION __FUNCTION__ - #define NAZARA_THREADLOCAL __thread #elif defined(_MSC_VER) #define NAZARA_COMPILER_MSVC #define NAZARA_DEPRECATED(txt) __declspec(deprecated(txt)) #define NAZARA_FUNCTION __FUNCSIG__ - #define NAZARA_THREADLOCAL __declspec(thread) #else #define NAZARA_COMPILER_UNKNOWN #define NAZARA_DEPRECATED(txt) #define NAZARA_FUNCTION __func__ // __func__ est standard depuis le C++11 - #define NAZARA_THREADLOCAL thread_local #error This compiler is not fully supported #endif diff --git a/src/Nazara/Renderer/Context.cpp b/src/Nazara/Renderer/Context.cpp index 0682a631e..e80dbb353 100644 --- a/src/Nazara/Renderer/Context.cpp +++ b/src/Nazara/Renderer/Context.cpp @@ -22,8 +22,8 @@ namespace { - NAZARA_THREADLOCAL const NzContext* currentContext = nullptr; - NAZARA_THREADLOCAL const NzContext* threadContext = nullptr; + thread_local const NzContext* currentContext = nullptr; + thread_local const NzContext* threadContext = nullptr; std::vector contexts;