Only use thread_local in builds with thread safety enabled
MSVC cannot dllexport thread_local variables, so we avoid making globals thread local if we won't support multiple threads anyway. Closes #3044
This commit is contained in:
7 files changed
+31
-7
No files matched your search
@@ -21,6 +21,6 @@ namespace Catch {
|
||||
|
||||
// Messages are owned by their individual threads, so the counter should be thread-local as well.
|
||||
// Alternative consideration: atomic, so threads don't share IDs and things are easier to debug.
|
||||
thread_local unsigned int MessageInfo::globalCount = 0;
|
||||
CATCH_INTERNAL_THREAD_LOCAL unsigned int MessageInfo::globalCount = 0;
|
||||
|
||||
} // end namespace Catch
|
||||
Reference in new issue
Block a user