From d1f278e45bc01b55556e72ca7ddb6ff8832b0cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ben=20Gr=C3=A4f?= Date: Sun, 1 Sep 2019 22:08:05 +0200 Subject: [PATCH] Fix mingw build --- src/cc/CCClient.cpp | 11 ++++++++++- src/version.h | 21 --------------------- 2 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/cc/CCClient.cpp b/src/cc/CCClient.cpp index 4a17b4af..b14ea480 100644 --- a/src/cc/CCClient.cpp +++ b/src/cc/CCClient.cpp @@ -55,6 +55,15 @@ #endif +namespace +{ + static std::string VersionString() + { + std::string version = std::to_string(APP_VER_MAJOR) + std::string(".") + std::to_string(APP_VER_MINOR) + + std::string(".") + std::to_string(APP_VER_PATCH); + return version; + } +} #ifdef TYPE_AMD_GPU xmrig::CCClient::CCClient(xmrig::Config* config, uv_async_t* async) @@ -120,7 +129,7 @@ void xmrig::CCClient::updateClientInfo() auto cpuInfo = xmrig::Cpu::info(); m_clientStatus.setClientId(clientId); - m_clientStatus.setVersion(Version::string()); + m_clientStatus.setVersion(VersionString()); m_clientStatus.setCpuBrand(cpuInfo->brand()); m_clientStatus.setCpuAES(cpuInfo->hasAES()); m_clientStatus.setCpuSockets(static_cast(cpuInfo->packages())); diff --git a/src/version.h b/src/version.h index 8064e538..3d5dd9c5 100644 --- a/src/version.h +++ b/src/version.h @@ -62,25 +62,4 @@ # endif #endif -#include - -class Version -{ -public: - inline static std::string string() - { - std::string version = std::to_string(APP_VER_MAJOR) + std::string(".") + std::to_string(APP_VER_MINOR) + - std::string(".") + std::to_string(APP_VER_PATCH); - - return version; - } - - inline static int code() - { - std::string version = std::to_string(APP_VER_MAJOR) + std::to_string(APP_VER_MINOR) + std::to_string(APP_VER_PATCH); - - return std::stoi(version); - } -}; - #endif /* XMRIG_VERSION_H */