forked from bblanchon/ArduinoJson
Remove ARDUINOJSON_HAS_NULLPTR
(#1820)
This commit is contained in:
@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
#include <catch.hpp>
|
#include <catch.hpp>
|
||||||
|
|
||||||
#if !ARDUINOJSON_HAS_NULLPTR
|
|
||||||
# error ARDUINOJSON_HAS_NULLPTR must be set to 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
TEST_CASE("nullptr") {
|
TEST_CASE("nullptr") {
|
||||||
DynamicJsonDocument doc(4096);
|
DynamicJsonDocument doc(4096);
|
||||||
JsonVariant variant = doc.to<JsonVariant>();
|
JsonVariant variant = doc.to<JsonVariant>();
|
||||||
|
@ -4,14 +4,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#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
|
// Support std::istream and std::ostream
|
||||||
#ifndef ARDUINOJSON_ENABLE_STD_STREAM
|
#ifndef ARDUINOJSON_ENABLE_STD_STREAM
|
||||||
# ifdef __has_include
|
# ifdef __has_include
|
||||||
@ -215,7 +207,7 @@
|
|||||||
# endif
|
# endif
|
||||||
#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
|
# error nullptr is defined as a macro. Remove the faulty #define or #undef nullptr
|
||||||
// See https://github.com/bblanchon/ArduinoJson/issues/1355
|
// See https://github.com/bblanchon/ArduinoJson/issues/1355
|
||||||
#endif
|
#endif
|
||||||
|
@ -181,8 +181,6 @@ struct Converter<SerializedValue<T>,
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#if ARDUINOJSON_HAS_NULLPTR
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct Converter<decltype(nullptr)> : private VariantAttorney {
|
struct Converter<decltype(nullptr)> : private VariantAttorney {
|
||||||
static void toJson(decltype(nullptr), JsonVariant dst) {
|
static void toJson(decltype(nullptr), JsonVariant dst) {
|
||||||
@ -197,8 +195,6 @@ struct Converter<decltype(nullptr)> : private VariantAttorney {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if ARDUINOJSON_ENABLE_ARDUINO_STREAM
|
#if ARDUINOJSON_ENABLE_ARDUINO_STREAM
|
||||||
|
|
||||||
class MemoryPoolPrint : public Print {
|
class MemoryPoolPrint : public Print {
|
||||||
|
@ -75,12 +75,10 @@ struct NullComparer : ComparerBase {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#if ARDUINOJSON_HAS_NULLPTR
|
|
||||||
template <>
|
template <>
|
||||||
struct Comparer<decltype(nullptr), void> : NullComparer {
|
struct Comparer<decltype(nullptr), void> : NullComparer {
|
||||||
explicit Comparer(decltype(nullptr)) : NullComparer() {}
|
explicit Comparer(decltype(nullptr)) : NullComparer() {}
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
struct ArrayComparer : ComparerBase {
|
struct ArrayComparer : ComparerBase {
|
||||||
const CollectionData* _rhs;
|
const CollectionData* _rhs;
|
||||||
|
Reference in New Issue
Block a user