mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-29 10:17:39 +02:00
Auto enable std::string and stream on modern compilers (closes #1156)
This commit is contained in:
@ -31,6 +31,29 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Auto enable std::stream if the right headers are here and no conflicting
|
||||
// macro is defined
|
||||
#if !defined(ARDUINOJSON_ENABLE_STD_STREAM) && defined(__has_include)
|
||||
#if __has_include(<istream>) && \
|
||||
__has_include(<ostream>) && \
|
||||
!defined(min) && \
|
||||
!defined(max)
|
||||
#define ARDUINOJSON_ENABLE_STD_STREAM 1
|
||||
#else
|
||||
#define ARDUINOJSON_ENABLE_STD_STREAM 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Auto enable std::string if the right header is here and no conflicting
|
||||
// macro is defined
|
||||
#if !defined(ARDUINOJSON_ENABLE_STD_STRING) && defined(__has_include)
|
||||
#if __has_include(<string>) && !defined(min) && !defined(max)
|
||||
#define ARDUINOJSON_ENABLE_STD_STRING 1
|
||||
#else
|
||||
#define ARDUINOJSON_ENABLE_STD_STRING 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if ARDUINOJSON_EMBEDDED_MODE
|
||||
|
||||
// Store floats by default to reduce the memory usage (issue #134)
|
||||
|
Reference in New Issue
Block a user