From 01b9b40bd223632ab6c5e4640fb4e2624af23a79 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Wed, 12 Jul 2023 14:54:19 +0200 Subject: [PATCH] Include `ARDUINOJSON_SLOT_OFFSET_SIZE` in the namespace name Ported from 433fb4b961593bd2314558c7acaaa2ba24a4c54a --- CHANGELOG.md | 3 ++- src/ArduinoJson/Namespace.hpp | 5 +++-- src/ArduinoJson/Polyfills/preprocessor.hpp | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6b71ade..6020dcdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,4 +16,5 @@ HEAD * Always store `serialized("string")` by copy (#1915) * Remove the zero-copy mode of `deserializeJson()` and `deserializeMsgPack()` * Fix double lookup in `to()` -* Fix double call to `size()` in `serializeMsgPack()` \ No newline at end of file +* Fix double call to `size()` in `serializeMsgPack()` +* Include `ARDUINOJSON_SLOT_OFFSET_SIZE` in the namespace name diff --git a/src/ArduinoJson/Namespace.hpp b/src/ArduinoJson/Namespace.hpp index 4ff672c7..e20390b9 100644 --- a/src/ArduinoJson/Namespace.hpp +++ b/src/ArduinoJson/Namespace.hpp @@ -11,14 +11,15 @@ #ifndef ARDUINOJSON_VERSION_NAMESPACE # define ARDUINOJSON_VERSION_NAMESPACE \ - ARDUINOJSON_CONCAT3(ARDUINOJSON_VERSION_MACRO, \ + ARDUINOJSON_CONCAT4(ARDUINOJSON_VERSION_MACRO, \ ARDUINOJSON_BIN2ALPHA(ARDUINOJSON_ENABLE_PROGMEM, \ ARDUINOJSON_USE_LONG_LONG, \ ARDUINOJSON_USE_DOUBLE, 1), \ ARDUINOJSON_BIN2ALPHA(ARDUINOJSON_ENABLE_NAN, \ ARDUINOJSON_ENABLE_INFINITY, \ ARDUINOJSON_ENABLE_COMMENTS, \ - ARDUINOJSON_DECODE_UNICODE)) + ARDUINOJSON_DECODE_UNICODE), \ + ARDUINOJSON_SLOT_OFFSET_SIZE) #endif diff --git a/src/ArduinoJson/Polyfills/preprocessor.hpp b/src/ArduinoJson/Polyfills/preprocessor.hpp index 78174143..6998f697 100644 --- a/src/ArduinoJson/Polyfills/preprocessor.hpp +++ b/src/ArduinoJson/Polyfills/preprocessor.hpp @@ -6,8 +6,8 @@ #define ARDUINOJSON_CONCAT_(A, B) A##B #define ARDUINOJSON_CONCAT2(A, B) ARDUINOJSON_CONCAT_(A, B) -#define ARDUINOJSON_CONCAT3(A, B, C) \ - ARDUINOJSON_CONCAT2(ARDUINOJSON_CONCAT2(A, B), C) +#define ARDUINOJSON_CONCAT4(A, B, C, D) \ + ARDUINOJSON_CONCAT2(ARDUINOJSON_CONCAT2(A, B), ARDUINOJSON_CONCAT2(C, D)) #define ARDUINOJSON_BIN2ALPHA_0000() A #define ARDUINOJSON_BIN2ALPHA_0001() B