diff --git a/CHANGES.current b/CHANGES.current index b014c94de..0dc0ff01a 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,10 @@ Version 1.3.36 (in progress) ============================= +05/07/2008: wsfulton + STL fixes when using %import rather than %include and the Solaris Workshop + compiler and the Roguewave STL. + 05/07/2008: wsfulton Fix wrapping of overloaded protected methods when using allprotected mode. Bug reported by Warren Wang. diff --git a/Lib/python/pycontainer.swg b/Lib/python/pycontainer.swg index a0769c133..8f1db7ce1 100644 --- a/Lib/python/pycontainer.swg +++ b/Lib/python/pycontainer.swg @@ -685,15 +685,12 @@ namespace swig { template inline void assign(const PySeq& pyseq, Seq* seq) { -%#ifdef SWIG_STD_NOASSIGN_STL + // seq->assign(pyseq.begin(), pyseq.end()); // not used as not always implemented 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 diff --git a/Lib/python/std_multiset.i b/Lib/python/std_multiset.i index 70f01f521..35a689026 100644 --- a/Lib/python/std_multiset.i +++ b/Lib/python/std_multiset.i @@ -10,15 +10,12 @@ template inline void assign(const PySeq& pyseq, std::multiset* seq) { -#ifdef SWIG_STD_NOINSERT_TEMPLATE_STL + // seq->insert(pyseq.begin(), pyseq.end()); // not used as not always implemented 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->insert(pyseq.begin(), pyseq.end()); -#endif } template diff --git a/Lib/python/std_set.i b/Lib/python/std_set.i index 0643b6ca1..94ef667e2 100644 --- a/Lib/python/std_set.i +++ b/Lib/python/std_set.i @@ -8,15 +8,12 @@ template inline void assign(const PySeq& pyseq, std::set* seq) { -#ifdef SWIG_STD_NOINSERT_TEMPLATE_STL + // seq->insert(pyseq.begin(), pyseq.end()); // not used as not always implemented 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->insert(pyseq.begin(), pyseq.end()); -#endif } template diff --git a/Lib/ruby/rubycontainer.swg b/Lib/ruby/rubycontainer.swg index fe762d7ba..e3cae5778 100644 --- a/Lib/ruby/rubycontainer.swg +++ b/Lib/ruby/rubycontainer.swg @@ -1004,15 +1004,12 @@ namespace swig { template inline void assign(const RubySeq& rubyseq, Seq* seq) { -%#ifdef SWIG_STD_NOASSIGN_STL + // seq->assign(rubyseq.begin(), rubyseq.end()); // not used as not always implemented typedef typename RubySeq::value_type value_type; typename RubySeq::const_iterator it = rubyseq.begin(); for (;it != rubyseq.end(); ++it) { seq->insert(seq->end(),(value_type)(*it)); } -%#else - seq->assign(rubyseq.begin(), rubyseq.end()); -%#endif } template diff --git a/Lib/ruby/std_multiset.i b/Lib/ruby/std_multiset.i index 01aca0ad3..87a7b292a 100644 --- a/Lib/ruby/std_multiset.i +++ b/Lib/ruby/std_multiset.i @@ -10,15 +10,12 @@ template inline void assign(const RubySeq& rubyseq, std::multiset* seq) { -#ifdef SWIG_STD_NOINSERT_TEMPLATE_STL + // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented typedef typename RubySeq::value_type value_type; typename RubySeq::const_iterator it = rubyseq.begin(); for (;it != rubyseq.end(); ++it) { seq->insert(seq->end(),(value_type)(*it)); } -#else - seq->insert(rubyseq.begin(), rubyseq.end()); -#endif } template diff --git a/Lib/ruby/std_set.i b/Lib/ruby/std_set.i index 32df256c4..64428abf6 100644 --- a/Lib/ruby/std_set.i +++ b/Lib/ruby/std_set.i @@ -8,15 +8,12 @@ template inline void assign(const RubySeq& rubyseq, std::set* seq) { -#ifdef SWIG_STD_NOINSERT_TEMPLATE_STL + // seq->insert(rubyseq.begin(), rubyseq.end()); // not used as not always implemented typedef typename RubySeq::value_type value_type; typename RubySeq::const_iterator it = rubyseq.begin(); for (;it != rubyseq.end(); ++it) { seq->insert(seq->end(),(value_type)(*it)); } -#else - seq->insert(rubyseq.begin(), rubyseq.end()); -#endif } template diff --git a/Lib/std/std_common.i b/Lib/std/std_common.i index c4eff4911..8b133c2e4 100644 --- a/Lib/std/std_common.i +++ b/Lib/std/std_common.i @@ -12,20 +12,11 @@ // Here, we identify compilers we know have problems with STL. %{ - -#if defined(__SUNPRO_CC) && defined(_RWSTD_VER) -# define SWIG_STD_NOASSIGN_STL -# define SWIG_STD_NOINSERT_TEMPLATE_STL -# define SWIG_STD_NOITERATOR_TRAITS_STL -#endif - #if defined(__GNUC__) # if __GNUC__ == 2 && __GNUC_MINOR <= 96 # define SWIG_STD_NOMODERN_STL # endif #endif - - %} // @@ -39,23 +30,27 @@ %fragment("StdIteratorTraits","header") %{ +#if defined(__SUNPRO_CC) && defined(_RWSTD_VER) +# if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL) +# define SWIG_STD_NOITERATOR_TRAITS_STL +# endif +#endif + #if !defined(SWIG_STD_NOITERATOR_TRAITS_STL) #include #else -namespace std { +namespace std { template struct iterator_traits { typedef ptrdiff_t difference_type; typedef typename Iterator::value_type value_type; }; -#if defined(__SUNPRO_CC) && defined(_RWSTD_VER) template struct iterator_traits<__reverse_bi_iterator > { typedef Distance difference_type; typedef T value_type; }; -#endif template struct iterator_traits { @@ -73,8 +68,7 @@ namespace std { } return __n; } - -} +} #endif %} diff --git a/Lib/typemaps/traits.swg b/Lib/typemaps/traits.swg index 37c09c04f..b39eb3946 100644 --- a/Lib/typemaps/traits.swg +++ b/Lib/typemaps/traits.swg @@ -10,20 +10,11 @@ // Here, we identify compilers we now have problems with STL. %{ - -#if defined(__SUNPRO_CC) -#define SWIG_STD_NOASSIGN_STL -#define SWIG_STD_NOINSERT_TEMPLATE_STL -#endif - - #if defined(__GNUC__) # if __GNUC__ == 2 && __GNUC_MINOR <= 96 # define SWIG_STD_NOMODERN_STL # endif #endif - - %} //