1Fermer3
HPMANLe 17/08/2018 à 04:22
I think GCC will always place a space after a token replacement, even when using ##

Put int blah=PLAYER1_PAL; in some file, then check the output with gcc -E file.c

Workaround:
#define PLAYER1_NAME KEN #if PLAYER1_NAME==KEN #define PLAYER1_JOY JoystickKEN #define PLAYER1_GFX (spriteInfo*)KEN #define PLAYER1_PAL (paletteInfo*)KEN_Palettes #endif #if PLAYER1_NAME==ASS #define PLAYER1_JOY JoystickASS #define PLAYER1_GFX (spriteInfo*)ASS #define PLAYER1_PAL (paletteInfo*)ASS_Palettes #endif
Or put pointers into tables and define the index.