add STRING_LITERAL macro back to nimbase.h for compatibility (#24957)

refs #24956, refs #24302
This commit is contained in:
metagn
2025-05-17 19:37:02 +03:00
committed by GitHub
parent 1e602490e9
commit e855019f84

View File

@@ -470,6 +470,13 @@ typedef char* NCSTRING;
#define NIM_STRLIT_FLAG ((NU)(1) << ((NIM_INTBITS) - 2)) /* This has to be the same as system.strlitFlag! */
/* unused in codegen after 2.2 but keep for compatibility: */
#define STRING_LITERAL(name, str, length) \
static const struct { \
TGenericSeq Sup; \
NIM_CHAR data[(length) + 1]; \
} name = {{length, (NI) ((NU)length | NIM_STRLIT_FLAG)}, str}
/* declared size of a sequence/variable length array: */
#if defined(__cplusplus) && defined(__clang__)
# define SEQ_DECL_SIZE 1