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:
Martin Hořeňovský committed 2025-12-02 14:01:55 +01:00
1 parent e849735e11
commit 32eac2d1bb
7 files changed
+31 -7

No files matched your search

+1 -1
View File
@@ -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