STL fixes when using %import rather than %include and the Solaris Workshop compiler

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10424 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2008-05-07 21:33:19 +00:00
commit da8791792b
9 changed files with 18 additions and 47 deletions

View file

@ -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.

View file

@ -685,15 +685,12 @@ namespace swig {
template <class PySeq, class Seq>
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 <class Seq, class T = typename Seq::value_type >

View file

@ -10,15 +10,12 @@
template <class PySeq, class T>
inline void
assign(const PySeq& pyseq, std::multiset<T>* 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 <class T>

View file

@ -8,15 +8,12 @@
template <class PySeq, class T>
inline void
assign(const PySeq& pyseq, std::set<T>* 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 <class T>

View file

@ -1004,15 +1004,12 @@ namespace swig {
template <class RubySeq, class Seq>
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 <class Seq, class T = typename Seq::value_type >

View file

@ -10,15 +10,12 @@
template <class RubySeq, class T>
inline void
assign(const RubySeq& rubyseq, std::multiset<T>* 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 <class T>

View file

@ -8,15 +8,12 @@
template <class RubySeq, class T>
inline void
assign(const RubySeq& rubyseq, std::set<T>* 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 <class T>

View file

@ -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 <iterator>
#else
namespace std {
namespace std {
template <class Iterator>
struct iterator_traits {
typedef ptrdiff_t difference_type;
typedef typename Iterator::value_type value_type;
};
#if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
template <class Iterator, class Category,class T, class Reference, class Pointer, class Distance>
struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > {
typedef Distance difference_type;
typedef T value_type;
};
#endif
template <class T>
struct iterator_traits<T*> {
@ -73,8 +68,7 @@ namespace std {
}
return __n;
}
}
}
#endif
%}

View file

@ -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
%}
//