From: Nishant R. <nis...@gm...> - 2014-05-22 04:25:05
|
Sorry, my bad. I got a little excited when I thought it was working. Any Idea why a typedef would generate SWIGTYPE_p_std__vectorT_MyType_t__value_type instead of SWIGTYPE_p_MyType_t? This is within a macro that converts containers to php arrays: %define container(Container) %typemap(out) Container { typedef Container::value_type Type; array_init(return_value); int const owned_by_zend = 2; for(auto itr = $1.begin(); itr != $1.end(); itr++) { zval *obj; MAKE_STD_ZVAL(obj); Type* copy = new Type(*itr); SWIG_SetPointerZval( obj, copy, $descriptor(Container::value_type*), owned_by_zend); add_next_index_zval(return_value, obj); } } .... %enddef Thanks, Nishant On Thu, May 22, 2014 at 1:03 PM, Nishant Rodrigues <nis...@gm...>wrote: > Hi, > > When using $descriptor in a typedef-ed type in typemaps, the wrong > SwigType is used. This patch fixes that. > > NOTE: I have not run tests. > > Thanks, > Nishant > > Source/CParse/util.c > @@ -47,7 +47,7 @@ void Swig_cparse_replace_descriptor(String *s) { > } > *d = 0; > arg = NewString(tmp + 12); > - t = Swig_cparse_type(arg); > + t = SwigType_typedef_resolve_all(Swig_cparse_type(arg)); > Delete(arg); > arg = 0; > > |