mirror of
https://github.com/xmrig/xmrig.git
synced 2025-03-23 23:58:53 +00:00
#196 Fix Linux build.
This commit is contained in:
parent
d403dcf95c
commit
4b00eb4a9f
5 changed files with 10 additions and 6 deletions
|
@ -22,6 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cmath>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ extern "C"
|
||||||
|
|
||||||
static inline double normalize(double d)
|
static inline double normalize(double d)
|
||||||
{
|
{
|
||||||
if (!std::isnormal(d)) {
|
if (!isnormal(d)) {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,9 @@
|
||||||
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <cmath>
|
#include <math.h>
|
||||||
#include <memory.h>
|
#include <memory.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "log/Log.h"
|
#include "log/Log.h"
|
||||||
#include "Options.h"
|
#include "Options.h"
|
||||||
|
@ -33,7 +34,7 @@
|
||||||
|
|
||||||
inline const char *format(double h, char* buf, size_t size)
|
inline const char *format(double h, char* buf, size_t size)
|
||||||
{
|
{
|
||||||
if (std::isnormal(h)) {
|
if (isnormal(h)) {
|
||||||
snprintf(buf, size, "%03.1f", h);
|
snprintf(buf, size, "%03.1f", h);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
@ -77,7 +78,7 @@ double Hashrate::calc(size_t ms) const
|
||||||
|
|
||||||
for (int i = 0; i < m_threads; ++i) {
|
for (int i = 0; i < m_threads; ++i) {
|
||||||
data = calc(i, ms);
|
data = calc(i, ms);
|
||||||
if (std::isnormal(data)) {
|
if (isnormal(data)) {
|
||||||
result += data;
|
result += data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,7 +171,7 @@ void Hashrate::stop()
|
||||||
void Hashrate::updateHighest()
|
void Hashrate::updateHighest()
|
||||||
{
|
{
|
||||||
double highest = calc(ShortInterval);
|
double highest = calc(ShortInterval);
|
||||||
if (std::isnormal(highest) && highest > m_highest) {
|
if (isnormal(highest) && highest > m_highest) {
|
||||||
m_highest = highest;
|
m_highest = highest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue