From 95f5d9d1349823c2d462f7ca2811dac9a9fd61f4 Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Tue, 18 Apr 2023 14:48:01 +0200 Subject: [PATCH] Fix compatibility with the Blynk libary (fixes #1914) Ported from 52d8a65cbccd5b3e873bf13fffbc66650c7d96d2 --- extras/scripts/publish.sh | 1 + extras/tests/Misc/conflicts.cpp | 3 +++ src/ArduinoJson/Namespace.hpp | 4 +--- src/ArduinoJson/Polyfills/preprocessor.hpp | 2 -- src/ArduinoJson/version.hpp | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/extras/scripts/publish.sh b/extras/scripts/publish.sh index a562a24c..d2a2ebc9 100755 --- a/extras/scripts/publish.sh +++ b/extras/scripts/publish.sh @@ -46,6 +46,7 @@ update_version_in_source () { -e "s/ARDUINOJSON_VERSION_MAJOR .*$/ARDUINOJSON_VERSION_MAJOR $MAJOR/" \ -e "s/ARDUINOJSON_VERSION_MINOR .*$/ARDUINOJSON_VERSION_MINOR $MINOR/" \ -e "s/ARDUINOJSON_VERSION_REVISION .*$/ARDUINOJSON_VERSION_REVISION $REVISION/" \ + -e "s/ARDUINOJSON_VERSION_MACRO .*$/ARDUINOJSON_VERSION_MACRO V$MAJOR$MINOR$REVISION/" \ src/ArduinoJson/version.hpp rm src/ArduinoJson/version.hpp*~ } diff --git a/extras/tests/Misc/conflicts.cpp b/extras/tests/Misc/conflicts.cpp index 2e33ea10..a4878a51 100644 --- a/extras/tests/Misc/conflicts.cpp +++ b/extras/tests/Misc/conflicts.cpp @@ -55,5 +55,8 @@ // issue #1905 #define _current +// issue #1914 +#define V7 7 + // catch.hpp mutes several warnings, this file also allows to detect them #include "ArduinoJson.h" diff --git a/src/ArduinoJson/Namespace.hpp b/src/ArduinoJson/Namespace.hpp index 8d6cfb85..4ff672c7 100644 --- a/src/ArduinoJson/Namespace.hpp +++ b/src/ArduinoJson/Namespace.hpp @@ -11,9 +11,7 @@ #ifndef ARDUINOJSON_VERSION_NAMESPACE # define ARDUINOJSON_VERSION_NAMESPACE \ - ARDUINOJSON_CONCAT3(ARDUINOJSON_CONCAT4(V, ARDUINOJSON_VERSION_MAJOR, \ - ARDUINOJSON_VERSION_MINOR, \ - ARDUINOJSON_VERSION_REVISION), \ + ARDUINOJSON_CONCAT3(ARDUINOJSON_VERSION_MACRO, \ ARDUINOJSON_BIN2ALPHA(ARDUINOJSON_ENABLE_PROGMEM, \ ARDUINOJSON_USE_LONG_LONG, \ ARDUINOJSON_USE_DOUBLE, 1), \ diff --git a/src/ArduinoJson/Polyfills/preprocessor.hpp b/src/ArduinoJson/Polyfills/preprocessor.hpp index b91baf74..78174143 100644 --- a/src/ArduinoJson/Polyfills/preprocessor.hpp +++ b/src/ArduinoJson/Polyfills/preprocessor.hpp @@ -8,8 +8,6 @@ #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 diff --git a/src/ArduinoJson/version.hpp b/src/ArduinoJson/version.hpp index db08e715..f61315ad 100644 --- a/src/ArduinoJson/version.hpp +++ b/src/ArduinoJson/version.hpp @@ -8,3 +8,4 @@ #define ARDUINOJSON_VERSION_MAJOR 7 #define ARDUINOJSON_VERSION_MINOR 0 #define ARDUINOJSON_VERSION_REVISION 0 +#define ARDUINOJSON_VERSION_MACRO V700