From 2fc54d240a31ac46d8bd9d17e00d96b2080f6088 Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 19 Jul 2019 05:03:14 +0700 Subject: [PATCH] Fixed build. --- cmake/flags.cmake | 2 +- src/backend/common/Hashrate.cpp | 8 ++++---- src/backend/cpu/CpuBackend.cpp | 2 +- src/core/Miner.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 3a0add7a8..3f2bd0a08 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -61,7 +61,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fno-exceptions -fno-rtti -Wno-missing-braces") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fexceptions -fno-rtti -Wno-missing-braces") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -funroll-loops -fmerge-all-constants") if (XMRIG_ARMv8) diff --git a/src/backend/common/Hashrate.cpp b/src/backend/common/Hashrate.cpp index a9c63733f..99a9a9c5f 100644 --- a/src/backend/common/Hashrate.cpp +++ b/src/backend/common/Hashrate.cpp @@ -24,7 +24,7 @@ #include -#include +#include #include #include @@ -37,7 +37,7 @@ inline static const char *format(double h, char *buf, size_t size) { - if (isnormal(h)) { + if (std::isnormal(h)) { snprintf(buf, size, "%03.1f", h); return buf; } @@ -82,7 +82,7 @@ double xmrig::Hashrate::calc(size_t ms) const for (size_t i = 0; i < m_threads; ++i) { data = calc(i, ms); - if (isnormal(data)) { + if (std::isnormal(data)) { result += data; } } @@ -153,7 +153,7 @@ void xmrig::Hashrate::add(size_t threadId, uint64_t count, uint64_t timestamp) void xmrig::Hashrate::updateHighest() { double highest = calc(ShortInterval); - if (isnormal(highest) && highest > m_highest) { + if (std::isnormal(highest) && highest > m_highest) { m_highest = highest; } } diff --git a/src/backend/cpu/CpuBackend.cpp b/src/backend/cpu/CpuBackend.cpp index 165ed42e3..ffc21597b 100644 --- a/src/backend/cpu/CpuBackend.cpp +++ b/src/backend/cpu/CpuBackend.cpp @@ -309,7 +309,7 @@ rapidjson::Value xmrig::CpuBackend::toJSON(rapidjson::Document &doc) const hugepages.PushBack(pages[1], allocator); out.AddMember("hugepages", hugepages, allocator); - out.AddMember("memory", d_ptr->algo.isValid() ? (ways * d_ptr->algo.memory()) : 0, allocator); + out.AddMember("memory", static_cast(d_ptr->algo.isValid() ? (ways * d_ptr->algo.memory()) : 0), allocator); if (d_ptr->threads.empty() || !hashrate()) { return out; diff --git a/src/core/Miner.cpp b/src/core/Miner.cpp index f6acde12e..df83c5e9a 100644 --- a/src/core/Miner.cpp +++ b/src/core/Miner.cpp @@ -134,7 +134,7 @@ public: cpu.AddMember("brand", StringRef(Cpu::info()->brand()), allocator); cpu.AddMember("aes", Cpu::info()->hasAES(), allocator); cpu.AddMember("x64", Cpu::info()->isX64(), allocator); - cpu.AddMember("sockets", Cpu::info()->sockets(), allocator); + cpu.AddMember("sockets", static_cast(Cpu::info()->sockets()), allocator); reply.AddMember("version", APP_VERSION, allocator); reply.AddMember("kind", APP_KIND, allocator);