diff options
| author | 2026-04-09 09:49:33 -0400 | |
|---|---|---|
| committer | 2026-04-09 09:49:33 -0400 | |
| commit | abe21ac46759ffef041e52310a17552f36ee9297 (patch) | |
| tree | 30abd744c7e0faea126a7b6fdf330eddc0e4280c /include/al/str.h | |
| parent | b5b765781482a7b3ff6026ea71b4eb35a0a155d0 (diff) | |
| download | libalabaster-abe21ac46759ffef041e52310a17552f36ee9297.tar.gz libalabaster-abe21ac46759ffef041e52310a17552f36ee9297.tar.bz2 libalabaster-abe21ac46759ffef041e52310a17552f36ee9297.zip | |
lib: Add strscmp() for static char arrays
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'include/al/str.h')
| -rw-r--r-- | include/al/str.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/al/str.h b/include/al/str.h index cb7c98f..20a1c26 100644 --- a/include/al/str.h +++ b/include/al/str.h @@ -16,8 +16,7 @@ typedef struct { #define al_str_at(s, index) (s)->data[index] #define al_str_atr(s, index) (s)->data[(s)->length - (index)] -#define al_chars_if_literal(s) ((char *)("" s "")) // use al_str_cs/cr for non-static arrays. -#define al_str_c(c) ((str){ (u32)(sizeof(c) - 1), 0, al_chars_if_literal(c) }) +#define al_str_c(c) ((str){ (u32)(sizeof(c) - 1), 0, AL_CHARS_IF_LITERAL(c) }) #define al_str_cs(c) ((str){ (u32)al_strnlen(c, sizeof(c)), 0, ((char *)(c)) }) // (s)ized #define al_str_cr(c) ((str){ (u32)al_strnlen(c, MAX_ALLOC_32), 0, ((char *)(c)) }) // (r)untime |