diff --git a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.cpp b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.cpp new file mode 100644 index 000000000000..c2e9fe3c4a39 --- /dev/null +++ b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.cpp @@ -0,0 +1,3 @@ +#include + +const std::string uiRuntimeName{"UI"}; diff --git a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.h b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.h new file mode 100644 index 000000000000..5efcf6477510 --- /dev/null +++ b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeData.h @@ -0,0 +1,10 @@ +#pragma once + +#include + +/** + * Unused, but kept for possible future use. + */ +constexpr uint64_t rnRuntimeId{0}; +constexpr uint64_t uiRuntimeId{1}; +extern const std::string uiRuntimeName; diff --git a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp index fee726c42df5..a42424cf2f4c 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp +++ b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp @@ -5,8 +5,6 @@ namespace worklets { -const std::string uiRuntimeName{"UI"}; - std::shared_ptr RuntimeManager::getRuntime(uint64_t runtimeId) { std::shared_lock lock(weakRuntimesMutex_); if (weakRuntimes_.contains(runtimeId)) { diff --git a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h index dbe82a1502c4..5d7574f26dde 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h +++ b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -18,13 +19,6 @@ namespace worklets { */ class JSIWorkletsModuleProxy; -/** - * Unused, but kept for possible future use. - */ -constexpr uint64_t rnRuntimeId{0}; -constexpr uint64_t uiRuntimeId{1}; -extern const std::string uiRuntimeName; - class RuntimeManager { public: std::shared_ptr getRuntime(uint64_t runtimeId); diff --git a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h index b1bca13e14d3..301b12837ffe 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +++ b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include