From 41f3d67055e72d13e1dd69433dc762bedd738508 Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Fri, 6 Jan 2006 01:17:47 +0000 Subject: [PATCH] fix for template + operators and compilers like gcc 3.3.5 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8233 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Swig/cwrap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/Swig/cwrap.c b/Source/Swig/cwrap.c index c7702173c..9c6edf26f 100644 --- a/Source/Swig/cwrap.c +++ b/Source/Swig/cwrap.c @@ -393,7 +393,14 @@ Swig_cmethod_call(String_or_char *name, ParmList *parms, String_or_char *self) { if (!self) self = (char *) "(this)->"; Append(func,self); - nname = SwigType_namestr(name); + if (SwigType_istemplate(name) && (strncmp(Char(name),"operator ",9) == 0)) { + /* fix for template + operators and compilers like gcc 3.3.5 */ + String *tprefix = SwigType_templateprefix(name); + nname = tprefix; + } else { + nname = SwigType_namestr(name); + } + pt = Getattr(p,k_type); /* If the method is invoked through a dereferenced pointer, we don't add any casts @@ -418,12 +425,6 @@ Swig_cmethod_call(String_or_char *name, ParmList *parms, String_or_char *self) { the rest seems not caring very much, */ if (SwigType_istemplate(name)) { - /* fix for compilers like gcc 3.3.5 + operator() */ - if (strstr(Char(nname),"operator ()") != 0) { - String *tprefix = SwigType_templateprefix(nname); - Delete(nname); - nname = tprefix; - } Printf(func,"SWIGTEMPLATEDISAMBIGUATOR %s(", nname); } else { Printf(func,"%s(", nname);