[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

swig questions




hi,

i've got a few questions about gooSwig.

1.
where can i get the lastest version,
the wiki web links to an old version.


2. 
are these issues easily fixed or are they limitations of swig

a. hex defs aren't recognised as constants
#define SDL_INIT_VIDEO 0x00000020

b. enums in macros prevent constants from being generated
enum { SDL_PRESSED = 0x01, SDL_RELEASED = 0x00 };
#define SDL_BUTTON(X) (SDL_PRESSED<<(X-1))
#define SDL_BUTTON_LEFT 1
#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT)

c. variable length arg lists
extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);


3.
when creating new_* functions wouldn't it be better to use
GC_malloc() or allocate() instead of calloc()?


4.
when i swigify these functions ii_set works,
but ff_set hangs the top-level, does anyone
else get this behaviour?

int ii = 0;
int ii_get () { return ii; }
int ii_set (int i) { ii = i; return ii; }

float ff = 0.f;
float ff_get () { return ff; }
float ff_set (float f) { ff = f; return ff; }

also, it would be nice if
export float ff;
automatically generated the get/set functions.

thanks.

--
 jan