mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-30 02:37:35 +02:00
Fix 'std::string' has not been declared (issue #1967)
This commit is contained in:
@ -1,6 +1,11 @@
|
|||||||
ArduinoJson: change log
|
ArduinoJson: change log
|
||||||
=======================
|
=======================
|
||||||
|
|
||||||
|
HEAD
|
||||||
|
----
|
||||||
|
|
||||||
|
* Fix error `'std::string' has not been declared` (issue #1967)
|
||||||
|
|
||||||
v6.21.3 (2023-07-23)
|
v6.21.3 (2023-07-23)
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -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>
|
@ -8,6 +8,10 @@
|
|||||||
#include <ArduinoJson/Variant/JsonVariantConst.hpp>
|
#include <ArduinoJson/Variant/JsonVariantConst.hpp>
|
||||||
#include <ArduinoJson/Variant/VariantFunctions.hpp>
|
#include <ArduinoJson/Variant/VariantFunctions.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