Lin728
28-12-2003, 14:00
Grüssi!
Ich habe jetzt schon ein wenig mit Tuxracer herumgespielt, weil ich ein paar features dazustopfen will.
Leider kann ich ein File nicht mit GCC 3.3 kompilieren, es enthält Macros dieser art:
#define FN_PARAM( name, typename, type ) \
type getparam_ ## name() { \
if ( !Params. ## name ## .loaded ) { \
fetch_param_ ## typename( &( Params. ## name ) ); \
} \
return Params. ## name ## .val. ## typename ## _val; \
} \
void setparam_ ## name( type val) { \
set_param_ ## typename( &( Params. ## name ), val ); }
#define FN_PARAM_STRING( name ) \
FN_PARAM( name, string, char* )
FN_PARAM_STRING( data_dir )
die es dann so benutzt:
void init_game_configuration()
{
INIT_PARAM_STRING(
data_dir, DATA_DIR,
"# The location of the Tux Racer data files" );
}
Der GCC 3.3 regt sich dann so auf:
game_config.c:420:27: pasting "." and "data_dir" does not give a valid preprocessing token
game_config.c:420:27: pasting "data_dir" and "." does not give a valid preprocessing token
game_config.c:420:27: pasting "." and "data_dir" does not give a valid preprocessing token
game_config.c:420:27: pasting "." and "data_dir" does not give a valid preprocessing token
game_config.c:420:27: pasting "data_dir" and "." does not give a valid preprocessing token
game_config.c:420:27: pasting "." and "string" does not give a valid preprocessing token
game_config.c:420:27: pasting "." and "data_dir" does not give a valid preprocessing token
Nachdem ich eher überhaupt kein C-Hacker bin, sagen mir weder die Fehlermeldungen noch die Macros wirklich was.
Die Macros dienen anscheinend dazu, setters/getters für eine Struktur die die Konfigurationsoptionen beinhaltet zu erzeugen.
Es scheint erst Probleme mir GCC 3.x zu geben, weil mit den älteren Compiliert muss es ja funktioniert haben, sonst hätten dies nicht so gemacht :-)
Ich habe jetzt schon ein wenig mit Tuxracer herumgespielt, weil ich ein paar features dazustopfen will.
Leider kann ich ein File nicht mit GCC 3.3 kompilieren, es enthält Macros dieser art:
#define FN_PARAM( name, typename, type ) \
type getparam_ ## name() { \
if ( !Params. ## name ## .loaded ) { \
fetch_param_ ## typename( &( Params. ## name ) ); \
} \
return Params. ## name ## .val. ## typename ## _val; \
} \
void setparam_ ## name( type val) { \
set_param_ ## typename( &( Params. ## name ), val ); }
#define FN_PARAM_STRING( name ) \
FN_PARAM( name, string, char* )
FN_PARAM_STRING( data_dir )
die es dann so benutzt:
void init_game_configuration()
{
INIT_PARAM_STRING(
data_dir, DATA_DIR,
"# The location of the Tux Racer data files" );
}
Der GCC 3.3 regt sich dann so auf:
game_config.c:420:27: pasting "." and "data_dir" does not give a valid preprocessing token
game_config.c:420:27: pasting "data_dir" and "." does not give a valid preprocessing token
game_config.c:420:27: pasting "." and "data_dir" does not give a valid preprocessing token
game_config.c:420:27: pasting "." and "data_dir" does not give a valid preprocessing token
game_config.c:420:27: pasting "data_dir" and "." does not give a valid preprocessing token
game_config.c:420:27: pasting "." and "string" does not give a valid preprocessing token
game_config.c:420:27: pasting "." and "data_dir" does not give a valid preprocessing token
Nachdem ich eher überhaupt kein C-Hacker bin, sagen mir weder die Fehlermeldungen noch die Macros wirklich was.
Die Macros dienen anscheinend dazu, setters/getters für eine Struktur die die Konfigurationsoptionen beinhaltet zu erzeugen.
Es scheint erst Probleme mir GCC 3.x zu geben, weil mit den älteren Compiliert muss es ja funktioniert haben, sonst hätten dies nicht so gemacht :-)