diff options
| author | Mai M <mathew1800@gmail.com> | 2022-01-13 23:34:55 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-13 23:34:55 -0500 |
| commit | e8bbfc26fe27c4a5c9e6b44afc4918067a70fb58 (patch) | |
| tree | c154122215e7dd3917ff4d57ed4d35eeb1b46ee1 /Source/Core/Common/Version.cpp | |
| parent | 07fd17445c6ca4e89b0cef023ba711bb27c920aa (diff) | |
| parent | 83c5446d852178794450f7c5833f7a047490ff31 (diff) | |
Merge pull request #10370 from leoetlino/siof
Fix static initialisation order fiasco issue for Version variables
Diffstat (limited to 'Source/Core/Common/Version.cpp')
| -rw-r--r-- | Source/Core/Common/Version.cpp | 57 |
1 files changed, 45 insertions, 12 deletions
diff --git a/Source/Core/Common/Version.cpp b/Source/Core/Common/Version.cpp index f6479c2158..7801aaae30 100644 --- a/Source/Core/Common/Version.cpp +++ b/Source/Core/Common/Version.cpp @@ -17,28 +17,61 @@ namespace Common #define BUILD_TYPE_STR "" #endif -const std::string scm_rev_str = "Dolphin " +const std::string& GetScmRevStr() +{ + static const std::string scm_rev_str = "Dolphin " #if !SCM_IS_MASTER - "[" SCM_BRANCH_STR "] " + "[" SCM_BRANCH_STR "] " #endif #ifdef __INTEL_COMPILER - BUILD_TYPE_STR SCM_DESC_STR "-ICC"; + BUILD_TYPE_STR SCM_DESC_STR "-ICC"; #else - BUILD_TYPE_STR SCM_DESC_STR; + BUILD_TYPE_STR SCM_DESC_STR; #endif + return scm_rev_str; +} + +const std::string& GetScmRevGitStr() +{ + static const std::string scm_rev_git_str = SCM_REV_STR; + return scm_rev_git_str; +} + +const std::string& GetScmDescStr() +{ + static const std::string scm_desc_str = SCM_DESC_STR; + return scm_desc_str; +} + +const std::string& GetScmBranchStr() +{ + static const std::string scm_branch_str = SCM_BRANCH_STR; + return scm_branch_str; +} + +const std::string& GetScmDistributorStr() +{ + static const std::string scm_distributor_str = SCM_DISTRIBUTOR_STR; + return scm_distributor_str; +} -const std::string scm_rev_git_str = SCM_REV_STR; -const std::string scm_desc_str = SCM_DESC_STR; -const std::string scm_branch_str = SCM_BRANCH_STR; -const std::string scm_distributor_str = SCM_DISTRIBUTOR_STR; -const std::string scm_update_track_str = SCM_UPDATE_TRACK_STR; +const std::string& GetScmUpdateTrackStr() +{ + static const std::string scm_update_track_str = SCM_UPDATE_TRACK_STR; + return scm_update_track_str; +} +const std::string& GetNetplayDolphinVer() +{ #ifdef _WIN32 -const std::string netplay_dolphin_ver = SCM_DESC_STR " Win"; + static const std::string netplay_dolphin_ver = SCM_DESC_STR " Win"; #elif __APPLE__ -const std::string netplay_dolphin_ver = SCM_DESC_STR " Mac"; + static const std::string netplay_dolphin_ver = SCM_DESC_STR " Mac"; #else -const std::string netplay_dolphin_ver = SCM_DESC_STR " Lin"; + static const std::string netplay_dolphin_ver = SCM_DESC_STR " Lin"; #endif + return netplay_dolphin_ver; +} + } // namespace Common |
