Skip to content
Browse files

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.
  • Loading branch information...
lioncash committed Jun 3, 2019
1 parent ebf3de4 commit ea9f8871703b802a1fc756433857338a68d22c1a
Showing with 2 additions and 5 deletions.
  1. +0 −3 Source/Core/Core/Analytics.cpp
  2. +2 −2 Source/Core/Core/Analytics.h
@@ -39,9 +39,6 @@ namespace
constexpr const char* ANALYTICS_ENDPOINT = "";
} // namespace

std::mutex DolphinAnalytics::s_instance_mutex;
std::shared_ptr<DolphinAnalytics> DolphinAnalytics::s_instance;

#if defined(ANDROID)
static std::function<std::string(std::string)> s_get_val_func;
void DolphinAnalytics::AndroidSetGetValFunc(std::function<std::string(std::string)> func)
@@ -127,6 +127,6 @@ class DolphinAnalytics

// 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<DolphinAnalytics> s_instance;
static inline std::mutex s_instance_mutex;
static inline std::shared_ptr<DolphinAnalytics> s_instance;

0 comments on commit ea9f887

Please sign in to comment.
You can’t perform that action at this time.