aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-05-04 02:02:35 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-05-04 02:02:35 +0200
commit3ec5c9cbfc26bf715451c83026832f1fdfd25092 (patch)
treeeafdbb0b7c2db87be2a0d35ec0269601677e3927
parentba56b5fa8344847077b49268d2ab215f3e73d10e (diff)
Add STR() and CONCAT() to macros.h
-rw-r--r--include/macros.h6
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())