Bonjour, jai un probleme avec mes macros. gcc 3.4.2 me dit:
m3d_c_bd.cpp:63:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_bd.cpp:84:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_bd.cpp:84:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_bd.cpp:84:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_bd.cpp:84:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_bd.cpp:124:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_bd.cpp:124:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_bd.cpp:124:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_bd.cpp:124:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_mai.cpp:368:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_mai.cpp:368:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_mai.cpp:368:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_mai.cpp:368:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_mai.cpp:524:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_mai.cpp:524:1: pasting ")" and "->" does not give a valid preprocessing token
m3d_c_mai.cpp:524:1: pasting ")" and "->" does not give a valid preprocessing token
Ces erreurs surviennent sur lappel au 2 macros suivante
#define SUPPRIMER_LISTE(type,tete,fin,entite)\
{\
struct mknom(st_,type) *pcourant, *scourant ;\
pcourant = PREC(entite) ;\
scourant = SUIVANT(entite) ;\
if (pcourant== NULL) {\
if (scourant == NULL) { \
PREC(entite) = NULL ;\
SUIVANT(entite) = NULL ;\
tete = NULL ;\
fin = NULL ;\
}\
else {\
scourant->prec = NULL ;\
PREC(entite) = NULL ;\
SUIVANT(entite) = NULL ;\
tete = scourant ;\
}\
}\
else {\
if (scourant == NULL) \
{pcourant->suivant = NULL ;\
PREC(entite) = NULL ;\
SUIVANT(entite) = NULL ;\
fin = pcourant ;}\
else {pcourant->suivant = scourant ;\
scourant->prec = pcourant ;\
PREC(entite) = NULL ;\
SUIVANT(entite) = NULL ;}\
}\
}
et
#define INSERER_TETE_LISTE(tete,fin,entite)\
PREC(entite) = NULL ;\
if (tete != NULL) {\
/* la queue est inchangee */\
SUIVANT(entite) = tete ;\
PREC(tete) = entite ;\
tete = entite ;\
}\
else {\
SUIVANT(entite) = NULL ;\
tete = entite ;\
fin = entite ;\
}
Qui eux utilisent PREC et SUIVANT
#define PREC(entite) mknom((entite),->prec)
#define SUIVANT(entite) mknom((entite),->suivant)
Qui eux utilisent mknom
#define mknom(a,b) a##b
Merci de venir a mon secours!