diff --git a/kotlin-native/runtime/src/main/cpp/AllocTest.cpp b/kotlin-native/runtime/src/main/cpp/AllocTest.cpp index 94ea54ec668..4b61017925a 100644 --- a/kotlin-native/runtime/src/main/cpp/AllocTest.cpp +++ b/kotlin-native/runtime/src/main/cpp/AllocTest.cpp @@ -18,7 +18,7 @@ class A : public KonanAllocatorAware { public: using DestructorHook = testing::StrictMock>; - static thread_local DestructorHook* destructorHook; + static THREAD_LOCAL_VARIABLE DestructorHook* destructorHook; explicit A(int value = -1) : value_(value) {} @@ -33,7 +33,7 @@ private: }; // static -thread_local A::DestructorHook* A::destructorHook = nullptr; +THREAD_LOCAL_VARIABLE A::DestructorHook* A::destructorHook = nullptr; struct B { explicit B(int value) : a(value) {} diff --git a/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.cpp b/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.cpp index 17e361c4a71..a344bb833d8 100644 --- a/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.cpp +++ b/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.cpp @@ -40,4 +40,4 @@ mm::ThreadRegistry::ThreadRegistry() = default; mm::ThreadRegistry::~ThreadRegistry() = default; // static -thread_local mm::ThreadRegistry::Node* mm::ThreadRegistry::currentThreadDataNode_ = nullptr; +THREAD_LOCAL_VARIABLE mm::ThreadRegistry::Node* mm::ThreadRegistry::currentThreadDataNode_ = nullptr; diff --git a/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.hpp b/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.hpp index 92462033101..00e2204d7e1 100644 --- a/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.hpp +++ b/kotlin-native/runtime/src/mm/cpp/ThreadRegistry.hpp @@ -8,6 +8,7 @@ #include +#include "Common.h" #include "SingleLockList.hpp" #include "Utils.hpp" @@ -48,7 +49,7 @@ private: ThreadRegistry(); ~ThreadRegistry(); - static thread_local Node* currentThreadDataNode_; + static THREAD_LOCAL_VARIABLE Node* currentThreadDataNode_; SingleLockList list_; };