From: Vedran P. <ved...@gm...> - 2009-09-05 04:43:12
|
Hi all, I am wrapping C++ for use in Lua. The current obstacle I am facing is that if I my function expects type like uint64_t* (--pointer), it doesn't get the right type. What I do is %include <stdint.i> explicitly inside the wrapper-generators. At runtime, Lua is not getting 'uint64_t*', but 'number', so the typecheck (2) inside the swig-generated function throws me out. Inside the generated wrapper, the variable is being cast to the right type (1), so I don't understand why is it throwing me out. 1) This gets generated as functions local variable: uint64_t *arg8 = (uint64_t *) 0 ; 2) This the check a few lines below if(!SWIG_isptrtype(L,8)) SWIG_fail_arg("functionName",8,"uint64_t *"); 3) This is the call to convert the type if (!SWIG_IsOK(SWIG_ConvertPtr(L,8,(void**)&arg8,SWIGTYPE_p_unsigned_long_long,0))){ SWIG_fail_ptr("functionName",8,SWIGTYPE_p_unsigned_long_long); } Can anyone explain what am I doing wrong? Thanks, -- Vedran Pogacnik |