diff options
| author | JosJuice <josjuice@gmail.com> | 2017-09-10 08:02:48 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-10 08:02:48 +0200 |
| commit | ee51ba639908ccbb13c3389344d17d3bbae2da1a (patch) | |
| tree | 02ccf253c0a7196dbcafd99524c07801d42c4791 /Source/Core/Common | |
| parent | e86713ca6726393f4b5a2dd2240b79828d6fcb4b (diff) | |
| parent | 696e1b40b58ee1ef9340ceac02059abbe63f3120 (diff) | |
Merge pull request #6047 from lioncash/version
Common: Move version strings to their own header
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/BitField.h | 1 | ||||
| -rw-r--r-- | Source/Core/Common/ChunkFile.h | 1 | ||||
| -rw-r--r-- | Source/Core/Common/Common.h | 13 | ||||
| -rw-r--r-- | Source/Core/Common/Common.vcxproj | 1 | ||||
| -rw-r--r-- | Source/Core/Common/Common.vcxproj.filters | 1 | ||||
| -rw-r--r-- | Source/Core/Common/LinearDiskCache.h | 6 | ||||
| -rw-r--r-- | Source/Core/Common/TraversalClient.cpp | 8 | ||||
| -rw-r--r-- | Source/Core/Common/TraversalClient.h | 11 | ||||
| -rw-r--r-- | Source/Core/Common/Version.cpp | 21 | ||||
| -rw-r--r-- | Source/Core/Common/Version.h | 18 |
10 files changed, 53 insertions, 28 deletions
diff --git a/Source/Core/Common/BitField.h b/Source/Core/Common/BitField.h index 59bee7b4b5..5832fbcc3f 100644 --- a/Source/Core/Common/BitField.h +++ b/Source/Core/Common/BitField.h @@ -31,6 +31,7 @@ #pragma once +#include <cstddef> #include <limits> #include <type_traits> diff --git a/Source/Core/Common/ChunkFile.h b/Source/Core/Common/ChunkFile.h index 497a6d439a..fdae41102b 100644 --- a/Source/Core/Common/ChunkFile.h +++ b/Source/Core/Common/ChunkFile.h @@ -15,6 +15,7 @@ #include <array> #include <cstddef> +#include <cstring> #include <deque> #include <list> #include <map> diff --git a/Source/Core/Common/Common.h b/Source/Core/Common/Common.h index 1d3fb2b33e..17b53b2bf5 100644 --- a/Source/Core/Common/Common.h +++ b/Source/Core/Common/Common.h @@ -4,19 +4,6 @@ #pragma once -#include <cstdio> -#include <cstdlib> -#include <cstring> -#include <string> - -// Git version number -extern const std::string scm_desc_str; -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 netplay_dolphin_ver; -extern const std::string scm_distributor_str; - // Force enable logging in the right modes. For some reason, something had changed // so that debugfast no longer logged. #if defined(_DEBUG) || defined(DEBUGFAST) diff --git a/Source/Core/Common/Common.vcxproj b/Source/Core/Common/Common.vcxproj index 71f500abf2..853cff6d0f 100644 --- a/Source/Core/Common/Common.vcxproj +++ b/Source/Core/Common/Common.vcxproj @@ -151,6 +151,7 @@ <ClInclude Include="TraversalClient.h" /> <ClInclude Include="TraversalProto.h" /> <ClInclude Include="UPnP.h" /> + <ClInclude Include="Version.h" /> <ClInclude Include="WorkQueueThread.h" /> <ClInclude Include="x64ABI.h" /> <ClInclude Include="x64Emitter.h" /> diff --git a/Source/Core/Common/Common.vcxproj.filters b/Source/Core/Common/Common.vcxproj.filters index ceef3ae8e0..985be49e17 100644 --- a/Source/Core/Common/Common.vcxproj.filters +++ b/Source/Core/Common/Common.vcxproj.filters @@ -68,6 +68,7 @@ <ClInclude Include="SysConf.h" /> <ClInclude Include="Thread.h" /> <ClInclude Include="Timer.h" /> + <ClInclude Include="Version.h" /> <ClInclude Include="WorkQueueThread.h" /> <ClInclude Include="x64ABI.h" /> <ClInclude Include="x64Emitter.h" /> diff --git a/Source/Core/Common/LinearDiskCache.h b/Source/Core/Common/LinearDiskCache.h index 630a624d6b..fae1dfc3f5 100644 --- a/Source/Core/Common/LinearDiskCache.h +++ b/Source/Core/Common/LinearDiskCache.h @@ -4,14 +4,15 @@ #pragma once +#include <algorithm> #include <cstring> #include <fstream> #include <string> #include <type_traits> -#include "Common/Common.h" #include "Common/CommonTypes.h" #include "Common/FileUtil.h" +#include "Common/Version.h" // On disk format: // header{ @@ -177,7 +178,8 @@ private: { // Null-terminator is intentionally not copied. std::memcpy(&id, "DCAC", sizeof(u32)); - std::memcpy(ver, scm_rev_git_str.c_str(), std::min(scm_rev_git_str.size(), sizeof(ver))); + std::memcpy(ver, Common::scm_rev_git_str.c_str(), + std::min(Common::scm_rev_git_str.size(), sizeof(ver))); } u32 id; diff --git a/Source/Core/Common/TraversalClient.cpp b/Source/Core/Common/TraversalClient.cpp index cc1e4a148d..13089b958c 100644 --- a/Source/Core/Common/TraversalClient.cpp +++ b/Source/Core/Common/TraversalClient.cpp @@ -1,9 +1,15 @@ // This file is public domain, in case it's useful to anyone. -comex #include "Common/TraversalClient.h" + +#include <cstddef> +#include <cstring> +#include <random> +#include <string> + +#include "Common/CommonTypes.h" #include "Common/Logging/Log.h" #include "Common/MsgHandler.h" -#include "Common/Timer.h" static void GetRandomishBytes(u8* buf, size_t size) { diff --git a/Source/Core/Common/TraversalClient.h b/Source/Core/Common/TraversalClient.h index befd530174..e85453e0e9 100644 --- a/Source/Core/Common/TraversalClient.h +++ b/Source/Core/Common/TraversalClient.h @@ -1,12 +1,15 @@ // This file is public domain, in case it's useful to anyone. -comex #pragma once -#include <enet/enet.h> -#include <functional> + +#include <cstddef> #include <list> #include <memory> -#include <random> -#include "Common/Common.h" +#include <string> + +#include <enet/enet.h> + +#include "Common/CommonTypes.h" #include "Common/Thread.h" #include "Common/TraversalProto.h" diff --git a/Source/Core/Common/Version.cpp b/Source/Core/Common/Version.cpp index fba14eeeb6..372eb3204d 100644 --- a/Source/Core/Common/Version.cpp +++ b/Source/Core/Common/Version.cpp @@ -2,9 +2,14 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. -#include "Common/Common.h" +#include "Common/Version.h" + +#include <string> + #include "Common/scmrev.h" +namespace Common +{ #ifdef _DEBUG #define BUILD_TYPE_STR "Debug " #elif defined DEBUGFAST @@ -24,16 +29,16 @@ const std::string scm_rev_str = "Dolphin " BUILD_TYPE_STR SCM_DESC_STR; #endif +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; + #ifdef _WIN32 const std::string netplay_dolphin_ver = SCM_DESC_STR " Win"; #elif __APPLE__ const std::string netplay_dolphin_ver = SCM_DESC_STR " Mac"; #else - const std::string netplay_dolphin_ver = SCM_DESC_STR " Lin"; +const std::string netplay_dolphin_ver = SCM_DESC_STR " Lin"; #endif - -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; +} // namespace Common diff --git a/Source/Core/Common/Version.h b/Source/Core/Common/Version.h new file mode 100644 index 0000000000..50c25d1dd4 --- /dev/null +++ b/Source/Core/Common/Version.h @@ -0,0 +1,18 @@ +// Copyright 2017 Dolphin Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include <string> + +namespace Common +{ +// Git version number +extern const std::string scm_desc_str; +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 netplay_dolphin_ver; +} // namespace Common |
