From ea9f8871703b802a1fc756433857338a68d22c1a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 3 Jun 2019 19:44:18 -0400 Subject: [PATCH] Core/Analytics: Use inline on static member variables Starting with C++17, this allows for the same behavior as the existing code, but without the need to manually write the out-of-class definitions as well. --- Source/Core/Core/Analytics.cpp | 3 --- Source/Core/Core/Analytics.h | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Analytics.cpp b/Source/Core/Core/Analytics.cpp index ea661df38c..ecf85be4ec 100644 --- a/Source/Core/Core/Analytics.cpp +++ b/Source/Core/Core/Analytics.cpp @@ -39,9 +39,6 @@ namespace constexpr const char* ANALYTICS_ENDPOINT = "https://analytics.dolphin-emu.org/report"; } // namespace -std::mutex DolphinAnalytics::s_instance_mutex; -std::shared_ptr DolphinAnalytics::s_instance; - #if defined(ANDROID) static std::function s_get_val_func; void DolphinAnalytics::AndroidSetGetValFunc(std::function func) diff --git a/Source/Core/Core/Analytics.h b/Source/Core/Core/Analytics.h index e711fe24bf..77faa3d80c 100644 --- a/Source/Core/Core/Analytics.h +++ b/Source/Core/Core/Analytics.h @@ -127,6 +127,6 @@ private: // Shared pointer in order to allow for multithreaded use of the instance and // avoid races at reinitialization time. - static std::mutex s_instance_mutex; - static std::shared_ptr s_instance; + static inline std::mutex s_instance_mutex; + static inline std::shared_ptr s_instance; };