gen: make _SLIT macro determine `len` at compile-time (#7131)
parent
9ea2608372
commit
f21b2b41ac
|
@ -267,7 +267,8 @@ static void* g_live_info = NULL;
|
|||
|
||||
//============================== HELPER C MACROS =============================*/
|
||||
//#define tos4(s, slen) ((string){.str=(s), .len=(slen)})
|
||||
#define _SLIT(s) ((string){.str=(byteptr)(s), .len=(strlen(s)), .is_lit=1})
|
||||
// `"" s` is used to enforce a string literal argument
|
||||
#define _SLIT(s) ((string){.str=(byteptr)("" s), .len=(sizeof(s)-1), .is_lit=1})
|
||||
#define _PUSH_MANY(arr, val, tmp, tmp_typ) {tmp_typ tmp = (val); array_push_many(arr, tmp.data, tmp.len);}
|
||||
#define _IN(typ, val, arr) array_##typ##_contains(arr, val)
|
||||
#define _IN_MAP(val, m) map_exists(m, val)
|
||||
|
|
Loading…
Reference in New Issue