[q-lang-users] Q and SDL
Brought to you by:
agraef
From: Andrew B. <and...@ya...> - 2007-04-15 00:54:07
|
Hi, all! After a long, distracting series of illnesses, I'm working once again at using SWIG to allow Q to call SDL. I've found a set of swig SDL wrappers for occam (search for "occsdl" with Google) which seemed like a good starting point. The problem that I run into is that I get some warnings from swig. SDL_keyboard.i:25: Warning(314): mod is a Q keyword SDL_events.i:72: Warning(314): type is a Q keyword SDL_events.i:79: Warning(314): type is a Q keyword SDL_events.i:87: Warning(314): type is a Q keyword The offending code seems obvious. typedef struct SDL_keysym { Uint8 scancode; /* hardware specific scancode */ int sym; /* SDL virtual keysym - enums*/ int mod; /* current key modifiers - enums*/ Uint16 unicode; /* translated character */ } SDL_keysym; ... and ... /* Application visibility event structure */ typedef struct SDL_ActiveEvent { Uint8 type; /* SDL_ACTIVEEVENT */ Uint8 gain; /* Whether given states were gained or lost (1/0) */ Uint8 state; /* A mask of the focus states */ } SDL_ActiveEvent; The "type is a Q keyword" one is repeated many times. I can clearly change "mod" to "SDL_mod" or something, and likewise "type" to "SDL_type" in order to avoid this, but just changing those two seems really vile. Changing all the identifiers in the structures seems less vile, but maybe equally unpleasant for anyone using this library. Does anyone have a better recommendation for how I might deal with this? -andrew |