summaryrefslogtreecommitdiffhomepage
path: root/include/stc/ccommon.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/stc/ccommon.h')
-rw-r--r--include/stc/ccommon.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h
index edf4b2cb..d7b68d1f 100644
--- a/include/stc/ccommon.h
+++ b/include/stc/ccommon.h
@@ -113,6 +113,10 @@
#define c_no_hash (1<<6)
#define c_no_lookup (c_no_cmp|c_no_eq|c_no_hash)
+#define c_initialize(C, ...) \
+ C##_from_n((C##_raw[])__VA_ARGS__, sizeof((C##_raw[])__VA_ARGS__)/sizeof(C##_raw))
+#define c_literal(C, ...) (*(C[]){c_initialize(C, __VA_ARGS__)})
+
/* Generic algorithms */
typedef const char* crawstr;