From e855019f84e93e01022ad57aa3624c8e4d237486 Mon Sep 17 00:00:00 2001 From: metagn Date: Sat, 17 May 2025 19:37:02 +0300 Subject: [PATCH] add STRING_LITERAL macro back to nimbase.h for compatibility (#24957) refs #24956, refs #24302 --- lib/nimbase.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/nimbase.h b/lib/nimbase.h index 3b4438331b..2144c84b0c 100644 --- a/lib/nimbase.h +++ b/lib/nimbase.h @@ -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