#615 Fixed build without libcpuid.

This commit is contained in:
XMRig 2018-05-08 06:19:10 +07:00
parent 4cd7af3da1
commit 6a4f817693

View file

@ -4,8 +4,8 @@
* Copyright 2014 Lucas Jones <https://github.com/lucasjones> * Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet> * Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com> * Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2016-2017 XMRig <support@xmrig.com> * Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* * Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -110,12 +110,12 @@ int Cpu::m_l2_cache = 0;
int Cpu::m_l3_cache = 0; int Cpu::m_l3_cache = 0;
int Cpu::m_sockets = 1; int Cpu::m_sockets = 1;
int Cpu::m_totalCores = 0; int Cpu::m_totalCores = 0;
int Cpu::m_totalThreads = 0; size_t Cpu::m_totalThreads = 0;
int Cpu::optimalThreadsCount(int algo, bool doubleHash, int maxCpuUsage) size_t Cpu::optimalThreadsCount(size_t size, int maxCpuUsage)
{ {
int count = m_totalThreads / 2; const size_t count = m_totalThreads / 2;
return count < 1 ? 1 : count; return count < 1 ? 1 : count;
} }