Commit 18ff0faf authored by Dmitry Frank's avatar Dmitry Frank Committed by Cesanta Bot

Implement stringify macro

And use it for `FW_ARCHITECTURE`. This is needed because with
Microchip's xc32, `-DFOO=\"bar\"` results in `FOO` being `bar`, not
`"bar"`, so we have to stringify differently.

PUBLISHED_FROM=d0aeebb55ef9e0e92a7f750104cd6600e0d9c636
parent 25de7914
......@@ -1846,6 +1846,23 @@ int cs_base64_decode(const unsigned char *s, int len, char *dst, int *dec_len);
#define CS_ENABLE_TO64 0
#endif
/*
* Expands to a string representation of its argument: e.g.
* `CS_STRINGIFY_LIT(5) expands to "5"`
*/
#define CS_STRINGIFY_LIT(x) #x
/*
* Expands to a string representation of its argument, which is allowed
* to be a macro: e.g.
*
* #define FOO 123
* CS_STRINGIFY_MACRO(FOO)
*
* expands to 123.
*/
#define CS_STRINGIFY_MACRO(x) CS_STRINGIFY_LIT(x)
#ifdef __cplusplus
extern "C" {
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment