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

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