Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2/internal/catch_message_info.cpp
diff options
context:
space:
mode:
authorMartin Hořeňovský2025-12-01 14:18:54 +0100
committerMartin Hořeňovský2025-12-02 14:01:55 +0100
commit32eac2d1bb63d6b58a32e341e22b9438f1bd041a (patch)
treeae6bce085b5422e93679c9b6d538451bb8e544d0 /src/catch2/internal/catch_message_info.cpp
parente849735e11f23ce9ec819e053b107f2ec3c3c1c4 (diff)
downloadcatch3-32eac2d1bb63d6b58a32e341e22b9438f1bd041a.tar.gz
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
Diffstat (limited to 'src/catch2/internal/catch_message_info.cpp')
-rw-r--r--src/catch2/internal/catch_message_info.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/catch2/internal/catch_message_info.cpp b/src/catch2/internal/catch_message_info.cpp
index bc887abf..2352f36c 100644
--- a/src/catch2/internal/catch_message_info.cpp
+++ b/src/catch2/internal/catch_message_info.cpp
@@ -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