Merge pull request #9732 from JosJuice/avoid-including-scmrev

Avoid including scmrev.h except in Version.cpp
This commit is contained in:
Mai M 2021-05-21 11:25:38 -04:00 committed by GitHub
commit 7d8c3ff7d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 7 deletions

View File

@ -33,6 +33,7 @@ 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;
#ifdef _WIN32
const std::string netplay_dolphin_ver = SCM_DESC_STR " Win";

View File

@ -14,5 +14,6 @@ extern const std::string scm_branch_str;
extern const std::string scm_rev_str;
extern const std::string scm_rev_git_str;
extern const std::string scm_distributor_str;
extern const std::string scm_update_track_str;
extern const std::string netplay_dolphin_ver;
} // namespace Common

View File

@ -29,7 +29,7 @@
#include "Common/MsgHandler.h"
#include "Common/NandPaths.h"
#include "Common/StringUtil.h"
#include "Common/scmrev.h"
#include "Common/Version.h"
#include "Core/Boot/Boot.h"
#include "Core/CommonTitles.h"
@ -601,7 +601,7 @@ void SConfig::LoadAutoUpdateSettings(IniFile& ini)
{
IniFile::Section* section = ini.GetOrCreateSection("AutoUpdate");
section->Get("UpdateTrack", &m_auto_update_track, SCM_UPDATE_TRACK_STR);
section->Get("UpdateTrack", &m_auto_update_track, Common::scm_update_track_str);
section->Get("HashOverride", &m_auto_update_hash_override, "");
}

View File

@ -12,7 +12,7 @@
#include "Common/NandPaths.h"
#include "Common/SettingsHandler.h"
#include "Common/Timer.h"
#include "Common/scmrev.h"
#include "Common/Version.h"
#include "Core/BootManager.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
@ -59,10 +59,10 @@ IPCReply GetVersion(const IOCtlVRequest& request)
return IPCReply(IPC_EINVAL);
}
const auto length = std::min(size_t(request.io_vectors[0].size), std::strlen(SCM_DESC_STR));
const auto length = std::min(size_t(request.io_vectors[0].size), Common::scm_desc_str.size());
Memory::Memset(request.io_vectors[0].address, 0, request.io_vectors[0].size);
Memory::CopyToEmu(request.io_vectors[0].address, SCM_DESC_STR, length);
Memory::CopyToEmu(request.io_vectors[0].address, Common::scm_desc_str.data(), length);
return IPCReply(IPC_SUCCESS);
}

View File

@ -12,7 +12,7 @@
#include "Common/HttpRequest.h"
#include "Common/Logging/Log.h"
#include "Common/StringUtil.h"
#include "Common/scmrev.h"
#include "Common/Version.h"
#include "Core/ConfigManager.h"
#ifdef _WIN32
@ -157,7 +157,7 @@ void AutoUpdateChecker::CheckForUpdate()
#endif
std::string version_hash = SConfig::GetInstance().m_auto_update_hash_override.empty() ?
SCM_REV_STR :
Common::scm_rev_str :
SConfig::GetInstance().m_auto_update_hash_override;
std::string url = "https://dolphin-emu.org/update/check/v1/" +
SConfig::GetInstance().m_auto_update_track + "/" + version_hash + "/" +