Changed item name/pluralName to a compound string (#7359)

This commit is contained in:
Nephrite
2025-08-08 19:51:16 +01:00
committed by GitHub
parent 070a4f1dfa
commit 38eb3461b9
4 changed files with 1050 additions and 1033 deletions

View File

@@ -32,6 +32,12 @@
/* Converts a string to a compound literal, essentially making it a pointer to const u8 */
#define COMPOUND_STRING(str) (const u8[]) _(str)
#define COMPOUND_STRING_SIZE_LIMIT(str, limit) (const u8[COMPOUND_STRING_CHECK_SIZE(str, limit)]) _(str)
/* Used for COMPOUND_STRING_SIZE_LIMIT. Stupid, but makes sure we only get
* one error message regardless of how many characters over the limit we are.
* Otherwise, GCC gives an error for each and every character (which is annoying). */
#define COMPOUND_STRING_CHECK_SIZE(str, limit) (sizeof(COMPOUND_STRING(str)) > limit ? sizeof(COMPOUND_STRING(str)) - 1 : sizeof(COMPOUND_STRING(str)))
/* Expands to the first/second/third/fourth argument. */
#define FIRST(a, ...) a