mirror of
https://github.com/cesanta/mongoose.git
synced 2024-12-27 15:01:03 +08:00
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
This commit is contained in:
parent
25de791424
commit
18ff0fafe0
17
mongoose.h
17
mongoose.h
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user