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.
This commit is contained in:
Lioncash 2019-06-03 19:44:18 -04:00
parent ebf3de4d93
commit ea9f887170
2 changed files with 2 additions and 5 deletions

View File

@ -39,9 +39,6 @@ namespace
constexpr const char* ANALYTICS_ENDPOINT = "https://analytics.dolphin-emu.org/report"; constexpr const char* ANALYTICS_ENDPOINT = "https://analytics.dolphin-emu.org/report";
} // namespace } // namespace
std::mutex DolphinAnalytics::s_instance_mutex;
std::shared_ptr<DolphinAnalytics> DolphinAnalytics::s_instance;
#if defined(ANDROID) #if defined(ANDROID)
static std::function<std::string(std::string)> s_get_val_func; static std::function<std::string(std::string)> s_get_val_func;
void DolphinAnalytics::AndroidSetGetValFunc(std::function<std::string(std::string)> func) void DolphinAnalytics::AndroidSetGetValFunc(std::function<std::string(std::string)> func)

View File

@ -127,6 +127,6 @@ private:
// Shared pointer in order to allow for multithreaded use of the instance and // Shared pointer in order to allow for multithreaded use of the instance and
// avoid races at reinitialization time. // avoid races at reinitialization time.
static std::mutex s_instance_mutex; static inline std::mutex s_instance_mutex;
static std::shared_ptr<DolphinAnalytics> s_instance; static inline std::shared_ptr<DolphinAnalytics> s_instance;
}; };