diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-05-04 02:02:35 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-05-04 02:02:35 +0200 |
commit | 3ec5c9cbfc26bf715451c83026832f1fdfd25092 (patch) | |
tree | eafdbb0b7c2db87be2a0d35ec0269601677e3927 /include | |
parent | ba56b5fa8344847077b49268d2ab215f3e73d10e (diff) |
Add STR() and CONCAT() to macros.h
Diffstat (limited to 'include')
-rw-r--r-- | include/macros.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/macros.h b/include/macros.h index 4a8108e..d4b53b4 100644 --- a/include/macros.h +++ b/include/macros.h @@ -11,6 +11,12 @@ #define streq(...) (!strcmp(__VA_ARGS__)) #define u8eq(...) (!u8cmp(__VA_ARGS__)) +#define _MLIB_STR(s) #s +#define _MLIB_CONCAT(x, y) x##y + +#define STR(s) _MLIB_STR(s) +#define CONCAT(x, y) _MLIB_CONCAT(x, y) + #ifdef NDEBUG # include <stddef.h> # define ASSUME(p) ((p) ? (void)0 : unreachable()) |