Fix typedef'd variable wrappers that use %naturalvar, eg, std::string.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9624 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-12-20 23:09:01 +00:00
commit d6f38ba217
2 changed files with 7 additions and 2 deletions

View file

@ -1,6 +1,9 @@
Version 1.3.32 (in progress) Version 1.3.32 (in progress)
============================ ============================
12/20/2006: wsfulton
Fix typedef'd variable wrappers that use %naturalvar, eg, std::string.
12/14/2006: wsfulton 12/14/2006: wsfulton
[C#] Add std::wstring and wchar_t typemaps [C#] Add std::wstring and wchar_t typemaps

View file

@ -435,14 +435,16 @@ int use_naturalvar_mode(Node *n) {
if (!nvar) { if (!nvar) {
/* look for feature in the class */ /* look for feature in the class */
SwigType *ty = Getattr(n, "type"); SwigType *ty = Getattr(n, "type");
if (SwigType_isclass(ty)) { SwigType *fullty = SwigType_typedef_resolve_all(ty);
if (SwigType_isclass(fullty)) {
Node *m = Copy(n); Node *m = Copy(n);
SwigType *tys = SwigType_strip_qualifiers(ty); SwigType *tys = SwigType_strip_qualifiers(fullty);
Swig_features_get(Swig_cparse_features(), 0, tys, 0, m); Swig_features_get(Swig_cparse_features(), 0, tys, 0, m);
nvar = GetFlag(m, "feature:naturalvar"); nvar = GetFlag(m, "feature:naturalvar");
Delete(tys); Delete(tys);
Delete(m); Delete(m);
} }
Delete(fullty);
} }
return nvar ? CWRAP_NATURAL_VAR : 0; return nvar ? CWRAP_NATURAL_VAR : 0;
} }