diff --git a/mongoose.h b/mongoose.h index 32fca84e..0d829fc9 100644 --- a/mongoose.h +++ b/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