From 3d7235fc8787c8f63ead313f0a891600dbc4d6fa Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 22 Feb 2018 19:22:50 +1300 Subject: MSVC 2013 Compile Fix/Workaround for "static thread_local" vars Apparently MSVC 2013 has trouble with stuff that's been declared "static thread_local" (and/or maybe even the "thread_local" keyword). https://stackoverflow.com/questions/29399494/what-is-the-current-state-of-support-for-thread-local-across-platforms --- intern/gawain/src/gwn_vertex_array_id.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'intern/gawain') diff --git a/intern/gawain/src/gwn_vertex_array_id.cpp b/intern/gawain/src/gwn_vertex_array_id.cpp index f0233dd0ef9..90a2b42ab67 100644 --- a/intern/gawain/src/gwn_vertex_array_id.cpp +++ b/intern/gawain/src/gwn_vertex_array_id.cpp @@ -46,7 +46,12 @@ struct Gwn_Context { #endif }; +#if defined(_MSC_VER) && (_MSC_VER == 1800) +#define thread_local __declspec(thread) +thread_local Gwn_Context* active_ctx = NULL; +#else static thread_local Gwn_Context* active_ctx = NULL; +#endif static void clear_orphans(Gwn_Context* ctx) { -- cgit v1.2.3