Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9732 from JosJuice/avoid-including-scmrev
Avoid including scmrev.h except in Version.cpp
  • Loading branch information
lioncash committed May 21, 2021
2 parents bc89df8 + 27cc0b5 commit 7d8c3ff
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions Source/Core/Common/Version.cpp
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/Version.h
Expand Up @@ -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
4 changes: 2 additions & 2 deletions Source/Core/Core/ConfigManager.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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, "");
}

Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/IOS/DolphinDevice.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/UICommon/AutoUpdate.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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 + "/" +
Expand Down

0 comments on commit 7d8c3ff

Please sign in to comment.