From 24a7abba20fda0092f35938e192c7adea385325e Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Tue, 31 Aug 2004 20:33:39 +0000 Subject: [PATCH] fix Solaris/assign problem git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6184 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Lib/python/std_common.i | 9 +++++++++ SWIG/Lib/python/std_container.i | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/SWIG/Lib/python/std_common.i b/SWIG/Lib/python/std_common.i index 4eaf8d108..97307b561 100644 --- a/SWIG/Lib/python/std_common.i +++ b/SWIG/Lib/python/std_common.i @@ -8,6 +8,15 @@ // //#define SWIG_STD_NOMODERN_STL +// Here, we identify compilers we now have problems with STL. +%{ + +#if defined(__SUNPRO_CC) && defined(_RWSTD_VER) +#define SWIG_STD_NOASSIGN_STL +#endif + +%} + // // Define or uncomment the following macro to instantiate by default // all the basic std typemaps (std::pair, std::vector, etc) diff --git a/SWIG/Lib/python/std_container.i b/SWIG/Lib/python/std_container.i index b4b3f9bab..d1261c3ee 100644 --- a/SWIG/Lib/python/std_container.i +++ b/SWIG/Lib/python/std_container.i @@ -105,7 +105,15 @@ template inline void assign(const PySeq& pyseq, Seq* seq) { +#ifdef SWIG_STD_NOASSIGN_STL + typedef typename PySeq::value_type value_type; + typename PySeq::const_iterator it = pyseq.begin(); + for (;it != pyseq.end(); ++it) { + seq->insert(seq->end(),(value_type)(*it)); + } +#else seq->assign(pyseq.begin(), pyseq.end()); +#endif } template