mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-30 18:57:32 +02:00
Fix 'std::string' has not been declared (issue #1967)
Ported from 259855a87b
This commit is contained in:
@ -6,6 +6,7 @@ add_executable(MiscTests
|
|||||||
arithmeticCompare.cpp
|
arithmeticCompare.cpp
|
||||||
conflicts.cpp
|
conflicts.cpp
|
||||||
FloatParts.cpp
|
FloatParts.cpp
|
||||||
|
issue1967.cpp
|
||||||
JsonString.cpp
|
JsonString.cpp
|
||||||
NoArduinoHeader.cpp
|
NoArduinoHeader.cpp
|
||||||
printable.cpp
|
printable.cpp
|
||||||
|
13
extras/tests/Misc/issue1967.cpp
Normal file
13
extras/tests/Misc/issue1967.cpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// ArduinoJson - https://arduinojson.org
|
||||||
|
// Copyright © 2014-2023, Benoit BLANCHON
|
||||||
|
// MIT License
|
||||||
|
|
||||||
|
// we expect ArduinoJson.h to include <string>
|
||||||
|
#define ARDUINOJSON_ENABLE_STD_STRING 1
|
||||||
|
|
||||||
|
// but we don't want it to included accidentally
|
||||||
|
#undef ARDUINO
|
||||||
|
#define ARDUINOJSON_ENABLE_STD_STREAM 0
|
||||||
|
#define ARDUINOJSON_ENABLE_STRING_VIEW 0
|
||||||
|
|
||||||
|
#include <ArduinoJson.h>
|
@ -9,6 +9,10 @@
|
|||||||
#include <ArduinoJson/Polyfills/utility.hpp>
|
#include <ArduinoJson/Polyfills/utility.hpp>
|
||||||
#include <ArduinoJson/Variant/JsonVariantConst.hpp>
|
#include <ArduinoJson/Variant/JsonVariantConst.hpp>
|
||||||
|
|
||||||
|
#if ARDUINOJSON_ENABLE_STD_STRING
|
||||||
|
# include <string>
|
||||||
|
#endif
|
||||||
|
|
||||||
ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE
|
ARDUINOJSON_BEGIN_PUBLIC_NAMESPACE
|
||||||
|
|
||||||
template <typename T, typename Enable>
|
template <typename T, typename Enable>
|
||||||
|
Reference in New Issue
Block a user