Remove ARDUINOJSON_HAS_NULLPTR (#1820)

This commit is contained in:
Benoit Blanchon
2023-02-10 09:05:02 +01:00
parent 2be4ee732a
commit 8f7211a50f
4 changed files with 1 additions and 19 deletions

View File

@ -2,10 +2,6 @@
#include <catch.hpp>
#if !ARDUINOJSON_HAS_NULLPTR
# error ARDUINOJSON_HAS_NULLPTR must be set to 1
#endif
TEST_CASE("nullptr") {
DynamicJsonDocument doc(4096);
JsonVariant variant = doc.to<JsonVariant>();

View File

@ -4,14 +4,6 @@
#pragma once
#ifndef ARDUINOJSON_HAS_NULLPTR
# if __cplusplus >= 201103L
# define ARDUINOJSON_HAS_NULLPTR 1
# else
# define ARDUINOJSON_HAS_NULLPTR 0
# endif
#endif
// Support std::istream and std::ostream
#ifndef ARDUINOJSON_ENABLE_STD_STREAM
# ifdef __has_include
@ -215,7 +207,7 @@
# endif
#endif
#if ARDUINOJSON_HAS_NULLPTR && defined(nullptr)
#if defined(nullptr)
# error nullptr is defined as a macro. Remove the faulty #define or #undef nullptr
// See https://github.com/bblanchon/ArduinoJson/issues/1355
#endif

View File

@ -181,8 +181,6 @@ struct Converter<SerializedValue<T>,
}
};
#if ARDUINOJSON_HAS_NULLPTR
template <>
struct Converter<decltype(nullptr)> : private VariantAttorney {
static void toJson(decltype(nullptr), JsonVariant dst) {
@ -197,8 +195,6 @@ struct Converter<decltype(nullptr)> : private VariantAttorney {
}
};
#endif
#if ARDUINOJSON_ENABLE_ARDUINO_STREAM
class MemoryPoolPrint : public Print {

View File

@ -75,12 +75,10 @@ struct NullComparer : ComparerBase {
}
};
#if ARDUINOJSON_HAS_NULLPTR
template <>
struct Comparer<decltype(nullptr), void> : NullComparer {
explicit Comparer(decltype(nullptr)) : NullComparer() {}
};
#endif
struct ArrayComparer : ComparerBase {
const CollectionData* _rhs;