Fixed build.

This commit is contained in:
XMRig 2019-07-10 02:28:45 +07:00
parent f42adafee0
commit 3bebf778da
5 changed files with 12 additions and 5 deletions

View file

@ -22,7 +22,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <math.h>
#include <cmath>
#include <string.h>
#include <uv.h>
@ -44,7 +44,7 @@ static inline rapidjson::Value normalize(double d)
{
using namespace rapidjson;
if (!isnormal(d)) {
if (!std::isnormal(d)) {
return Value(kNullType);
}

View file

@ -22,6 +22,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <algorithm>
#include <assert.h>
#include <libcpuid.h>
#include <math.h>

View file

@ -124,8 +124,8 @@ static inline bool has_ossave()
xmrig::BasicCpuInfo::BasicCpuInfo() :
m_assembly(Assembly::NONE),
m_brand(),
m_aes(has_aes_ni()),
m_brand(),
m_avx2(has_avx2() && has_ossave()),
m_threads(std::thread::hardware_concurrency())
{

View file

@ -55,8 +55,8 @@ protected:
private:
Assembly m_assembly;
bool m_aes;
char m_brand[64 + 6];
const bool m_aes;
const bool m_avx2;
const size_t m_threads;
};

View file

@ -37,8 +37,8 @@
xmrig::BasicCpuInfo::BasicCpuInfo() :
m_aes(false),
m_avx2(false),
m_brand(),
m_avx2(false),
m_threads(std::thread::hardware_concurrency())
{
# ifdef XMRIG_ARMv8
@ -61,3 +61,9 @@ size_t xmrig::BasicCpuInfo::optimalThreadsCount(size_t memSize, int maxCpuUsage)
{
return threads();
}
xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm) const
{
return CpuThreads(threads());
}