From 21942d03a066849ee47092ce86287a277db04d9f Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Tue, 2 Nov 2004 22:06:25 +0000 Subject: [PATCH] Fix for compiler dependent macro. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6629 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/common.swg | 19 ------------------- SWIG/Lib/swig.swg | 29 +++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/SWIG/Lib/common.swg b/SWIG/Lib/common.swg index df8afe5ac..4446b3b54 100644 --- a/SWIG/Lib/common.swg +++ b/SWIG/Lib/common.swg @@ -35,25 +35,6 @@ #endif #endif -/* - SWIG_TEMPLATE_DISAMBIGUATOR is needed when wrapping template calls - (cwrap.c:Swig_cfunction_call/Swig_cmethod_call), as in - - result = nspace::template function(arg1); - result = arg1->template method(arg2); - - SWIG_TEMPLATE_DISAMBIGUATOR is compiler dependent (common.swg), - - SUN Studio requires 'template', - - gcc-3.4 forbids the use of 'template'. - - gcc-3.2.3 produces internal errors if you use 'template' -*/ -#ifndef SWIG_TEMPLATE_DISAMBIGUATOR -# if defined(__SUNPRO_CC) -# define SWIG_TEMPLATE_DISAMBIGUATOR template -# else -# define SWIG_TEMPLATE_DISAMBIGUATOR -# endif -#endif /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ diff --git a/SWIG/Lib/swig.swg b/SWIG/Lib/swig.swg index 6362797e0..1bfcf151a 100644 --- a/SWIG/Lib/swig.swg +++ b/SWIG/Lib/swig.swg @@ -410,3 +410,32 @@ static int NAME(TYPE x) { %} %enddef + +/*********************************************************************** + * + * This section contains generic SWIG macros for runtime compiler support. + * + ************************************************************************/ + +%{ +/* + SWIG_TEMPLATE_DISAMBIGUATOR is needed when wrapping template calls + (cwrap.c:Swig_cfunction_call/Swig_cmethod_call), as in + + result = nspace::template function(arg1); + result = arg1->template method(arg2); + + SWIG_TEMPLATE_DISAMBIGUATOR is compiler dependent (common.swg), + - SUN Studio requires 'template', + - gcc-3.4 forbids the use of 'template'. + - gcc-3.2.3 produces internal errors if you use 'template' +*/ +#ifndef SWIG_TEMPLATE_DISAMBIGUATOR +# if defined(__SUNPRO_CC) +# define SWIG_TEMPLATE_DISAMBIGUATOR template +# else +# define SWIG_TEMPLATE_DISAMBIGUATOR +# endif +#endif + +%}