Instead of "long", you should specify a return type of "int32_t" - though I think you'll get away with specifying "int" (thereby avoiding the typemap issue that NERDVANA mentioned), which is the same as "int32_t" everywhere.