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:
parent
b0ecf14e31
commit
da8791792b
9 changed files with 18 additions and 47 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
Version 1.3.36 (in progress)
|
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
|
05/07/2008: wsfulton
|
||||||
Fix wrapping of overloaded protected methods when using allprotected mode.
|
Fix wrapping of overloaded protected methods when using allprotected mode.
|
||||||
Bug reported by Warren Wang.
|
Bug reported by Warren Wang.
|
||||||
|
|
|
||||||
|
|
@ -685,15 +685,12 @@ namespace swig {
|
||||||
template <class PySeq, class Seq>
|
template <class PySeq, class Seq>
|
||||||
inline void
|
inline void
|
||||||
assign(const PySeq& pyseq, Seq* seq) {
|
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;
|
typedef typename PySeq::value_type value_type;
|
||||||
typename PySeq::const_iterator it = pyseq.begin();
|
typename PySeq::const_iterator it = pyseq.begin();
|
||||||
for (;it != pyseq.end(); ++it) {
|
for (;it != pyseq.end(); ++it) {
|
||||||
seq->insert(seq->end(),(value_type)(*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 >
|
template <class Seq, class T = typename Seq::value_type >
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,12 @@
|
||||||
template <class PySeq, class T>
|
template <class PySeq, class T>
|
||||||
inline void
|
inline void
|
||||||
assign(const PySeq& pyseq, std::multiset<T>* seq) {
|
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;
|
typedef typename PySeq::value_type value_type;
|
||||||
typename PySeq::const_iterator it = pyseq.begin();
|
typename PySeq::const_iterator it = pyseq.begin();
|
||||||
for (;it != pyseq.end(); ++it) {
|
for (;it != pyseq.end(); ++it) {
|
||||||
seq->insert(seq->end(),(value_type)(*it));
|
seq->insert(seq->end(),(value_type)(*it));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
seq->insert(pyseq.begin(), pyseq.end());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,12 @@
|
||||||
template <class PySeq, class T>
|
template <class PySeq, class T>
|
||||||
inline void
|
inline void
|
||||||
assign(const PySeq& pyseq, std::set<T>* seq) {
|
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;
|
typedef typename PySeq::value_type value_type;
|
||||||
typename PySeq::const_iterator it = pyseq.begin();
|
typename PySeq::const_iterator it = pyseq.begin();
|
||||||
for (;it != pyseq.end(); ++it) {
|
for (;it != pyseq.end(); ++it) {
|
||||||
seq->insert(seq->end(),(value_type)(*it));
|
seq->insert(seq->end(),(value_type)(*it));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
seq->insert(pyseq.begin(), pyseq.end());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
|
||||||
|
|
@ -1004,15 +1004,12 @@ namespace swig {
|
||||||
template <class RubySeq, class Seq>
|
template <class RubySeq, class Seq>
|
||||||
inline void
|
inline void
|
||||||
assign(const RubySeq& rubyseq, Seq* seq) {
|
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;
|
typedef typename RubySeq::value_type value_type;
|
||||||
typename RubySeq::const_iterator it = rubyseq.begin();
|
typename RubySeq::const_iterator it = rubyseq.begin();
|
||||||
for (;it != rubyseq.end(); ++it) {
|
for (;it != rubyseq.end(); ++it) {
|
||||||
seq->insert(seq->end(),(value_type)(*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 >
|
template <class Seq, class T = typename Seq::value_type >
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,12 @@
|
||||||
template <class RubySeq, class T>
|
template <class RubySeq, class T>
|
||||||
inline void
|
inline void
|
||||||
assign(const RubySeq& rubyseq, std::multiset<T>* seq) {
|
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;
|
typedef typename RubySeq::value_type value_type;
|
||||||
typename RubySeq::const_iterator it = rubyseq.begin();
|
typename RubySeq::const_iterator it = rubyseq.begin();
|
||||||
for (;it != rubyseq.end(); ++it) {
|
for (;it != rubyseq.end(); ++it) {
|
||||||
seq->insert(seq->end(),(value_type)(*it));
|
seq->insert(seq->end(),(value_type)(*it));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
seq->insert(rubyseq.begin(), rubyseq.end());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
|
||||||
|
|
@ -8,15 +8,12 @@
|
||||||
template <class RubySeq, class T>
|
template <class RubySeq, class T>
|
||||||
inline void
|
inline void
|
||||||
assign(const RubySeq& rubyseq, std::set<T>* seq) {
|
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;
|
typedef typename RubySeq::value_type value_type;
|
||||||
typename RubySeq::const_iterator it = rubyseq.begin();
|
typename RubySeq::const_iterator it = rubyseq.begin();
|
||||||
for (;it != rubyseq.end(); ++it) {
|
for (;it != rubyseq.end(); ++it) {
|
||||||
seq->insert(seq->end(),(value_type)(*it));
|
seq->insert(seq->end(),(value_type)(*it));
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
seq->insert(rubyseq.begin(), rubyseq.end());
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
|
||||||
|
|
@ -12,20 +12,11 @@
|
||||||
|
|
||||||
// Here, we identify compilers we know have problems with STL.
|
// 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 defined(__GNUC__)
|
||||||
# if __GNUC__ == 2 && __GNUC_MINOR <= 96
|
# if __GNUC__ == 2 && __GNUC_MINOR <= 96
|
||||||
# define SWIG_STD_NOMODERN_STL
|
# define SWIG_STD_NOMODERN_STL
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -39,23 +30,27 @@
|
||||||
|
|
||||||
|
|
||||||
%fragment("StdIteratorTraits","header") %{
|
%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)
|
#if !defined(SWIG_STD_NOITERATOR_TRAITS_STL)
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#else
|
#else
|
||||||
namespace std {
|
namespace std {
|
||||||
template <class Iterator>
|
template <class Iterator>
|
||||||
struct iterator_traits {
|
struct iterator_traits {
|
||||||
typedef ptrdiff_t difference_type;
|
typedef ptrdiff_t difference_type;
|
||||||
typedef typename Iterator::value_type value_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>
|
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> > {
|
struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > {
|
||||||
typedef Distance difference_type;
|
typedef Distance difference_type;
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
struct iterator_traits<T*> {
|
struct iterator_traits<T*> {
|
||||||
|
|
@ -73,8 +68,7 @@ namespace std {
|
||||||
}
|
}
|
||||||
return __n;
|
return __n;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,20 +10,11 @@
|
||||||
|
|
||||||
// Here, we identify compilers we now have problems with STL.
|
// 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 defined(__GNUC__)
|
||||||
# if __GNUC__ == 2 && __GNUC_MINOR <= 96
|
# if __GNUC__ == 2 && __GNUC_MINOR <= 96
|
||||||
# define SWIG_STD_NOMODERN_STL
|
# define SWIG_STD_NOMODERN_STL
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue