I happen to have read ArduinoJson/version.hpp
, which contains the following macro:
#define ARDUINOJSON_VERSION_MACRO V701
Now, I'm a python dev of very basic acquiantance with C from ctypes(gen).
To me it looks like V701
is an undeclared variable, but this definitely seems intentional.
Can anyone explain to me what is going on? What is the purpose of this and why is the value not in quotes?
It's not used by itself as a value. In Namespace.hpp, you find the use:
# define ARDUINOJSON_VERSION_NAMESPACE \
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_SLOT_ID_SIZE)
Then searching for the definition of ARDUINO_JSON_CONCAT4
you find:
#define ARDUINOJSON_CONCAT_(A, B) A##B
#define ARDUINOJSON_CONCAT2(A, B) ARDUINOJSON_CONCAT_(A, B)
#define ARDUINOJSON_CONCAT4(A, B, C, D) \
ARDUINOJSON_CONCAT2(ARDUINOJSON_CONCAT2(A, B), ARDUINOJSON_CONCAT2(C, D))
So it's eventually used in token pasting, and will become part of the value of ARDUINOJSON_VERSION_NAMESPACE
.