Add wapp_str8_lit_ro_initialiser_list to fix gcc compilation errors

This commit is contained in:
2025-02-22 14:33:15 +00:00
parent 0d795cc0d9
commit f89a4bf343
2 changed files with 22 additions and 17 deletions

View File

@@ -53,6 +53,11 @@ struct str8_list {
#define wapp_str8_lit_ro(STRING) ((Str8RO){.capacity = sizeof(STRING) - 1, \
.size = sizeof(STRING) - 1, \
.buf = (c8 *)STRING})
// To be used only when initialising a static storage variable in compilers that don't support
// initialisers with the syntax of wapp_str8_lit_ro
#define wapp_str8_lit_ro_initialiser_list(STRING) {.capacity = sizeof(STRING) - 1, \
.size = sizeof(STRING) - 1, \
.buf = (c8 *)STRING}
/**
* Str8 allocated buffers