Skip to content

Commit e855019

Browse files
authored
add STRING_LITERAL macro back to nimbase.h for compatibility (#24957)
refs #24956, refs #24302
1 parent 1e60249 commit e855019

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/nimbase.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,13 @@ typedef char* NCSTRING;
470470

471471
#define NIM_STRLIT_FLAG ((NU)(1) << ((NIM_INTBITS) - 2)) /* This has to be the same as system.strlitFlag! */
472472

473+
/* unused in codegen after 2.2 but keep for compatibility: */
474+
#define STRING_LITERAL(name, str, length) \
475+
static const struct { \
476+
TGenericSeq Sup; \
477+
NIM_CHAR data[(length) + 1]; \
478+
} name = {{length, (NI) ((NU)length | NIM_STRLIT_FLAG)}, str}
479+
473480
/* declared size of a sequence/variable length array: */
474481
#if defined(__cplusplus) && defined(__clang__)
475482
# define SEQ_DECL_SIZE 1

0 commit comments

Comments
 (0)