From: Curtis Dunham Date: Fri, 9 May 2014 22:58:46 +0000 (-0400) Subject: scons: Require SWIG >= 2.0.4 and remove vector typemaps X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad019c5c58ac8983f53be2cdf87e7a81f260a5ef;p=gem5.git scons: Require SWIG >= 2.0.4 and remove vector typemaps SWIG commit fd666c1 (*) made it unnecessary for gem5 to have these typemaps to handle Vector types. * https://github.com/swig/swig/commit/fd666c1440628a847793bbe1333c27dfa2f757f0 --- diff --git a/SConstruct b/SConstruct index a1aad32d4..4df529b83 100755 --- a/SConstruct +++ b/SConstruct @@ -726,23 +726,12 @@ if len(swig_version) < 3 or \ print 'Error determining SWIG version.' Exit(1) -min_swig_version = '1.3.34' +min_swig_version = '2.0.4' if compareVersions(swig_version[2], min_swig_version) < 0: print 'Error: SWIG version', min_swig_version, 'or newer required.' print ' Installed version:', swig_version[2] Exit(1) -# Older versions of swig do not play well with more recent versions of -# gcc due to assumptions on implicit includes (cstddef) and use of -# namespaces -if main['GCC'] and compareVersions(gcc_version, '4.6') > 0 and \ - compareVersions(swig_version[2], '2') < 0: - print '\n' + termcap.Yellow + termcap.Bold + \ - 'Warning: SWIG 1.x cause issues with gcc 4.6 and later.\n' + \ - termcap.Normal + \ - 'Use SWIG 2.x to avoid assumptions on implicit includes\n' + \ - 'and use of namespaces\n' - # Set up SWIG flags & scanner swig_flags=Split('-c++ -python -modern -templatereduce $_CPPINCFLAGS') main.Append(SWIGFLAGS=swig_flags) diff --git a/src/python/m5/params.py b/src/python/m5/params.py index 0afc200a8..470b94754 100644 --- a/src/python/m5/params.py +++ b/src/python/m5/params.py @@ -299,26 +299,6 @@ class VectorParamDesc(ParamDesc): ptype = self.ptype_str cxx_type = self.ptype.cxx_type - code('''\ -%typemap(in) std::vector< $cxx_type >::value_type { - if (SWIG_ConvertPtr($$input, (void **)&$$1, $$1_descriptor, 0) == -1) { - if (SWIG_ConvertPtr($$input, (void **)&$$1, - $$descriptor($cxx_type), 0) == -1) { - return NULL; - } - } -} - -%typemap(in) std::vector< $cxx_type >::value_type * { - if (SWIG_ConvertPtr($$input, (void **)&$$1, $$1_descriptor, 0) == -1) { - if (SWIG_ConvertPtr($$input, (void **)&$$1, - $$descriptor($cxx_type *), 0) == -1) { - return NULL; - } - } -} -''') - code('%template(vector_$ptype) std::vector< $cxx_type >;') def cxx_predecls(self, code):