j'ai un problème de C, pas de C++.
Un poil de code aidera tout de suite mieux à comprendre :
module.h
typedef struct
{
SDL_Surface* background;
SDL_Rect bgPosition;
ICON* iconList;
} MODULE_DATA;
icon.h
typedef struct
{
int width, height;
SDL_Rect position;
SDL_Surface* currentSprite;
SDL_Surface* spriteEnabled;
SDL_Surface* spriteDisabled;
SDL_Surface* spriteClicked;
int isEnabled;
int isClicked;
int isMouseOn;
void (*execOnClick)(MODULE_DATA* data);
} ICON;
Comme on voit, module.h aurait besoin d'inclure icon.h et vice versa...
Zerosquare m'a donné un tip :
- void (*execOnClick)(MODULE_DATA* data); + void (*execOnClick)(struct MODULE_DATA* data);
Mais je me prends deux warnings à chaque inclusion de icon.h :
‘struct MODULE_DATA’ declared inside parameter list warning: its scope is only this definition or declaration, which is probably not what you want
Comment résoudre élégamment ce genre de problème ?
)
