Skip to content

Commit 9f78cce

Browse files
move LightGBM-vendored json11 into a LightGBM-specific namespace (fixes #5944) (#5946)
1 parent 8de30d7 commit 9f78cce

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

include/LightGBM/tree_learner.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
namespace LightGBM {
1616

17-
using json11::Json;
17+
using json11_internal_lightgbm::Json;
1818

1919
/*! \brief forward declaration */
2020
class Tree;

include/LightGBM/utils/common.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace LightGBM {
5858

5959
namespace Common {
6060

61-
using json11::Json;
61+
using json11_internal_lightgbm::Json;
6262

6363
/*!
6464
* Imbues the stream with the C locale.

include/LightGBM/utils/json11.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
#include <utility>
6161
#include <vector>
6262

63-
namespace json11 {
63+
namespace json11_internal_lightgbm {
6464

6565
enum JsonParse { STANDARD, COMMENTS };
6666

@@ -223,4 +223,4 @@ class JsonValue {
223223
virtual ~JsonValue() {}
224224
};
225225

226-
} // namespace json11
226+
} // namespace json11_internal_lightgbm

src/boosting/gbdt.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
namespace LightGBM {
3131

32-
using json11::Json;
32+
using json11_internal_lightgbm::Json;
3333

3434
/*!
3535
* \brief GBDT algorithm implementation. including Training, prediction, bagging.

src/io/dataset_loader.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
namespace LightGBM {
1717

18-
using json11::Json;
18+
using json11_internal_lightgbm::Json;
1919

2020
DatasetLoader::DatasetLoader(const Config& io_config, const PredictFunction& predict_fun, int num_class, const char* filename)
2121
:config_(io_config), random_(config_.data_random_seed), predict_fun_(predict_fun), num_class_(num_class) {

src/io/json11.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include <cstdlib>
2828
#include <limits>
2929

30-
namespace json11 {
30+
namespace json11_internal_lightgbm {
3131

3232
static const int max_depth = 200;
3333

@@ -160,7 +160,7 @@ class Value : public JsonValue {
160160
}
161161

162162
const T m_value;
163-
void dump(string *out) const override { json11::dump(m_value, out); }
163+
void dump(string *out) const override { json11_internal_lightgbm::dump(m_value, out); }
164164
};
165165

166166
class JsonDouble final : public Value<Json::NUMBER, double> {
@@ -777,4 +777,4 @@ bool Json::has_shape(const shape &types, string *err) const {
777777
return true;
778778
}
779779

780-
} // namespace json11
780+
} // namespace json11_internal_lightgbm

src/treelearner/gpu_tree_learner.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
namespace LightGBM {
3838

39-
using json11::Json;
39+
using json11_internal_lightgbm::Json;
4040

4141
/*!
4242
* \brief GPU-based parallel learning algorithm.

src/treelearner/serial_tree_learner.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
namespace LightGBM {
3939

40-
using json11::Json;
40+
using json11_internal_lightgbm::Json;
4141

4242
/*! \brief forward declaration */
4343
class CostEfficientGradientBoosting;

0 commit comments

Comments
 (0)