From c99f939fe68c70dbae06160c379f771b9493dd70 Mon Sep 17 00:00:00 2001 From: "Marco Antonio J. Costa" Date: Wed, 22 Jul 2026 11:26:35 -0300 Subject: [PATCH] stop pasting a directive name onto the comma after it DIRECTIVE_TEXT builds four enumerator names from one directive name: #define DIRECTIVE_TEXT(id) RCDT_##id##, RCDT_##id##_EFFECT, ... The last ## on the first name has nothing to paste onto but the comma that follows, and RCDT_GATHER_SUPPLIES, is not a token. The other three pastes are well formed; only this one runs off the end of the name. MSVC concatenates the text and re-lexes it, so it recovers the identifier and the comma and produces the right enumerators; clang diagnoses it. Removing the stray ## gives the same ten enumerations, and MISSION_TEXT just below already spells it this way. Verification: grep -rn '##[A-Za-z_]*##[,)]' --include=*.h --include=*.cpp . # nothing ninja -C build parse # token-paste class gone: 55 -> 45 sites ninja -C build -k 0 # Release, four applications, green ninja -C build-debug -k 0 # Debug, four applications, green Co-Authored-By: Claude Opus 4.8 --- Strategic/Rebel Command.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Strategic/Rebel Command.cpp b/Strategic/Rebel Command.cpp index af235a412..9b51a446d 100644 --- a/Strategic/Rebel Command.cpp +++ b/Strategic/Rebel Command.cpp @@ -106,7 +106,7 @@ Points of interest: #include #include -#define DIRECTIVE_TEXT(id) RCDT_##id##, RCDT_##id##_EFFECT, RCDT_##id##_DESC, RCDT_##id##_IMPROVE, +#define DIRECTIVE_TEXT(id) RCDT_##id, RCDT_##id##_EFFECT, RCDT_##id##_DESC, RCDT_##id##_IMPROVE, #define MISSION_TEXT(id) RCAMT_##id##_TITLE, RCAMT_##id##_DESC, #define ADMIN_ACTION_CHANGE_COST 15000