Skip to content

Commit 8f7211a

Browse files
committed
Remove ARDUINOJSON_HAS_NULLPTR (#1820)
1 parent 2be4ee7 commit 8f7211a

File tree

4 files changed

+1
-19
lines changed

4 files changed

+1
-19
lines changed

extras/tests/JsonVariant/nullptr.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
#include <catch.hpp>
44

5-
#if !ARDUINOJSON_HAS_NULLPTR
6-
# error ARDUINOJSON_HAS_NULLPTR must be set to 1
7-
#endif
8-
95
TEST_CASE("nullptr") {
106
DynamicJsonDocument doc(4096);
117
JsonVariant variant = doc.to<JsonVariant>();

src/ArduinoJson/Configuration.hpp

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44

55
#pragma once
66

7-
#ifndef ARDUINOJSON_HAS_NULLPTR
8-
# if __cplusplus >= 201103L
9-
# define ARDUINOJSON_HAS_NULLPTR 1
10-
# else
11-
# define ARDUINOJSON_HAS_NULLPTR 0
12-
# endif
13-
#endif
14-
157
// Support std::istream and std::ostream
168
#ifndef ARDUINOJSON_ENABLE_STD_STREAM
179
# ifdef __has_include
@@ -215,7 +207,7 @@
215207
# endif
216208
#endif
217209

218-
#if ARDUINOJSON_HAS_NULLPTR && defined(nullptr)
210+
#if defined(nullptr)
219211
# error nullptr is defined as a macro. Remove the faulty #define or #undef nullptr
220212
// See https://github.com/bblanchon/ArduinoJson/issues/1355
221213
#endif

src/ArduinoJson/Variant/ConverterImpl.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ struct Converter<SerializedValue<T>,
181181
}
182182
};
183183

184-
#if ARDUINOJSON_HAS_NULLPTR
185-
186184
template <>
187185
struct Converter<decltype(nullptr)> : private VariantAttorney {
188186
static void toJson(decltype(nullptr), JsonVariant dst) {
@@ -197,8 +195,6 @@ struct Converter<decltype(nullptr)> : private VariantAttorney {
197195
}
198196
};
199197

200-
#endif
201-
202198
#if ARDUINOJSON_ENABLE_ARDUINO_STREAM
203199

204200
class MemoryPoolPrint : public Print {

src/ArduinoJson/Variant/VariantCompare.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,10 @@ struct NullComparer : ComparerBase {
7575
}
7676
};
7777

78-
#if ARDUINOJSON_HAS_NULLPTR
7978
template <>
8079
struct Comparer<decltype(nullptr), void> : NullComparer {
8180
explicit Comparer(decltype(nullptr)) : NullComparer() {}
8281
};
83-
#endif
8482

8583
struct ArrayComparer : ComparerBase {
8684
const CollectionData* _rhs;

0 commit comments

Comments
 (0)