diff --git a/SWIG/CHANGES.current b/SWIG/CHANGES.current index 9c4956f1f..ba47f12b8 100644 --- a/SWIG/CHANGES.current +++ b/SWIG/CHANGES.current @@ -5,6 +5,7 @@ Version 1.3.29 (In progress) Fix all the errors reported for 1.3.28. + - fix bug #1060789 - fix bug #1263457 - fix 'const char*&' typemap in the UTL, reported by Geoff Hutchison - fixes for python 2.1 and the runtime library diff --git a/SWIG/Examples/test-suite/preproc.i b/SWIG/Examples/test-suite/preproc.i index 6250fb42b..210365346 100644 --- a/SWIG/Examples/test-suite/preproc.i +++ b/SWIG/Examples/test-suite/preproc.i @@ -309,3 +309,6 @@ int test(int defined) #pragma SWIG cpperraswarn=1 #error "Some error" + +#define MASK(shift, size) (((1 << (size)) - 1) <<(shift)) +#define SOME_MASK_DEF (80*MASK(8, 10)) diff --git a/SWIG/Source/Swig/stype.c b/SWIG/Source/Swig/stype.c index c250aae96..2a703191f 100644 --- a/SWIG/Source/Swig/stype.c +++ b/SWIG/Source/Swig/stype.c @@ -500,7 +500,7 @@ SwigType_namestr(const SwigType *t) { char *d = Char(t); char *c = strstr(d,"<("); - if (!c) return NewString(t); + if (!c || !strstr(c+2,")>")) return NewString(t); r = NewStringWithSize(d, c - d); if (*(c - 1) == '<') Putc(' ',r); diff --git a/SWIG/Source/Swig/typeobj.c b/SWIG/Source/Swig/typeobj.c index c62f6f518..372b2f3d5 100644 --- a/SWIG/Source/Swig/typeobj.c +++ b/SWIG/Source/Swig/typeobj.c @@ -857,7 +857,8 @@ SwigType_templateargs(const SwigType *t) { int SwigType_istemplate(const SwigType *t) { - if (strstr(Char(t),"<(")) return 1; + char *ct = Char(t); + if ((ct = strstr(ct,"<(")) && (strstr(ct + 2,")>"))) return 1; return 0; }