Universal fix for NaN and Infinity in JSON output
This commit is contained in:
parent
184d6100dc
commit
682834b87d
2 changed files with 11 additions and 3 deletions
|
@ -29,6 +29,8 @@ else()
|
|||
set(WITH_VAES OFF)
|
||||
endif()
|
||||
|
||||
add_definitions(-DRAPIDJSON_WRITE_DEFAULT_FLAGS=6) # rapidjson::kWriteNanAndInfFlag | rapidjson::kWriteNanAndInfNullFlag
|
||||
|
||||
if (ARM_V8)
|
||||
set(ARM_TARGET 8)
|
||||
elseif (ARM_V7)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* XMRig
|
||||
* Copyright (c) 2018-2024 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2024 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright (c) 2018-2025 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright (c) 2016-2025 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* 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
|
||||
|
@ -31,7 +31,7 @@
|
|||
#include "base/tools/Chrono.h"
|
||||
#include "base/tools/Cvt.h"
|
||||
#include "core/config/Config.h"
|
||||
#include "core/Controller.h"
|
||||
#include "rapidjson/writer.h"
|
||||
#include "version.h"
|
||||
|
||||
|
||||
|
@ -46,6 +46,12 @@
|
|||
namespace xmrig {
|
||||
|
||||
|
||||
static_assert(
|
||||
RAPIDJSON_WRITE_DEFAULT_FLAGS == (rapidjson::kWriteNanAndInfFlag | rapidjson::kWriteNanAndInfNullFlag),
|
||||
"(rapidjson::kWriteNanAndInfFlag | rapidjson::kWriteNanAndInfNullFlag) required"
|
||||
);
|
||||
|
||||
|
||||
static rapidjson::Value getResources(rapidjson::Document &doc)
|
||||
{
|
||||
using namespace rapidjson;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue