Fix $typemap() expansion for "ctype" typemap

This didn't work correctly before because we need to override the base class
replaceSpecialVariables() method to expand $resolved_type, which appears
during the expansion, using the type supplied as $typemap() argument instead
of doing it later using it the type to which the typemap containing the macro
is attached.

This is a prerequisite for implementing smart pointers support.
This commit is contained in:
Vadim Zeitlin 2016-04-27 13:09:23 +02:00
commit 9204e57cc1

View file

@ -331,6 +331,18 @@ public:
Delete(type);
}
/*----------------------------------------------------------------------
* replaceSpecialVariables()
*
* Override the base class method to ensure that $resolved_type is expanded correctly inside $typemap().
*--------------------------------------------------------------------*/
virtual void replaceSpecialVariables(String *method, String *tm, Parm *parm) {
(void)method;
SwigType *type = Getattr(parm, "type");
substituteResolvedType(type, tm);
}
/* ------------------------------------------------------------
* main()
* ------------------------------------------------------------ */