Add stubs for JSON_ARRAY_SIZE, JSON_OBJECT_SIZE, and JSON_STRING_SIZE

This commit is contained in:
Benoit Blanchon
2023-08-09 18:58:30 +02:00
parent e93fd7657f
commit 1d583f68da
3 changed files with 40 additions and 1 deletions
+20
View File
@@ -24,6 +24,26 @@
#define ARDUINOJSON_NAMESPACE _Pragma ("GCC warning \"ARDUINOJSON_NAMESPACE is deprecated, use ArduinoJson instead\"") ArduinoJson
// DEPRECATED: you don't need to compute the size anymore
#define JSON_ARRAY_SIZE(N) _Pragma ("GCC warning \"JSON_ARRAY_SIZE is deprecated, you don't need to compute the size anymore\"") (ArduinoJson::detail::sizeofArray(N))
// DEPRECATED: you don't need to compute the size anymore
#define JSON_OBJECT_SIZE(N) _Pragma ("GCC warning \"JSON_OBJECT_SIZE is deprecated, you don't need to compute the size anymore\"") (ArduinoJson::detail::sizeofObject(N))
// DEPRECATED: you don't need to compute the size anymore
#define JSON_STRING_SIZE(N) _Pragma ("GCC warning \"JSON_STRING_SIZE is deprecated, you don't need to compute the size anymore\"") (ArduinoJson::detail::sizeofString(N))
#else
// DEPRECATED: you don't need to compute the size anymore
#define JSON_ARRAY_SIZE(N) (ArduinoJson::detail::sizeofArray(N))
// DEPRECATED: you don't need to compute the size anymore
#define JSON_OBJECT_SIZE(N) (ArduinoJson::detail::sizeofObject(N))
// DEPRECATED: you don't need to compute the size anymore
#define JSON_STRING_SIZE(N) (ArduinoJson::detail::sizeofString(N))
#endif
// clang-format on