diff --git a/mozilla/string/public/nsAReadableString.h b/mozilla/string/public/nsAReadableString.h index 8468929d402..4defc3e415c 100644 --- a/mozilla/string/public/nsAReadableString.h +++ b/mozilla/string/public/nsAReadableString.h @@ -35,17 +35,6 @@ #include "nsCharTraits.h" #endif -#include - // for |bidirectional_iterator_tag| - -#include - // for |min|, |copy| - - -#ifdef HAVE_CPP_NAMESPACE_STD -using std::bidirectional_iterator_tag; -#endif - /* This file defines the abstract interfaces |nsAReadableString| and |nsAReadableCString| (the 'A' is for 'abstract', as opposed to the 'I' in @@ -87,14 +76,14 @@ template class basic_nsAWritableString; template class nsReadingIterator - : public bidirectional_iterator_tag +// : public bidirectional_iterator_tag { public: typedef ptrdiff_t difference_type; typedef CharT value_type; typedef const CharT* pointer; typedef const CharT& reference; - typedef bidirectional_iterator_tag iterator_category; +// typedef bidirectional_iterator_tag iterator_category; private: friend class basic_nsAReadableString; diff --git a/mozilla/string/public/nsAWritableString.h b/mozilla/string/public/nsAWritableString.h index c1ecf414948..21fd709a863 100644 --- a/mozilla/string/public/nsAWritableString.h +++ b/mozilla/string/public/nsAWritableString.h @@ -48,14 +48,14 @@ template class basic_nsAWritableString; template class nsWritingIterator - : public bidirectional_iterator_tag +// : public bidirectional_iterator_tag { public: typedef ptrdiff_t difference_type; typedef CharT value_type; typedef CharT* pointer; typedef CharT& reference; - typedef bidirectional_iterator_tag iterator_category; +// typedef bidirectional_iterator_tag iterator_category; private: friend class basic_nsAWritableString; diff --git a/mozilla/xpcom/base/nscore.h b/mozilla/xpcom/base/nscore.h index e451ef4f0de..bcaf0325883 100644 --- a/mozilla/xpcom/base/nscore.h +++ b/mozilla/xpcom/base/nscore.h @@ -173,15 +173,6 @@ typedef PRUint16 PRUnichar; #define HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL #endif -#ifdef HAVE_CPP_NAMESPACE_STD - #define NS_STD_ std -#else - #define NS_STD_ -#endif - -#define NS_MIN NS_STD_ ::min -#define NS_MAX NS_STD_ ::max - /* under VC++ (Windows), we don't have autoconf yet */ #if defined(_MSC_VER) && (_MSC_VER>=1100) /* VC++ 5.0 and greater implement template specialization, 4.2 is unknown */ @@ -201,13 +192,6 @@ typedef PRUint16 PRUnichar; #define HAVE_CPP_NAMESPACE_STD #define HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL - - /* VC++ is special and doesn't use naked min() and max() */ - #undef NS_MIN - #define NS_MIN std::_cpp_min - - #undef NS_MAX - #define NS_MAX std::_cpp_max #endif #ifdef HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX @@ -266,4 +250,21 @@ typedef PRUint16 PRUnichar; the semantics. So if you want to dynamic_cast, then just use it "straight", no macro. */ +template +inline +const T& +NS_MIN( const T& a, const T& b ) + { + return b < a ? b : a; + } + +template +inline +const T& +NS_MAX( const T& a, const T& b ) + { + return a > b ? a : b; + } + + #endif /* nscore_h___ */ diff --git a/mozilla/xpcom/ds/nsAReadableString.h b/mozilla/xpcom/ds/nsAReadableString.h index 8468929d402..4defc3e415c 100644 --- a/mozilla/xpcom/ds/nsAReadableString.h +++ b/mozilla/xpcom/ds/nsAReadableString.h @@ -35,17 +35,6 @@ #include "nsCharTraits.h" #endif -#include - // for |bidirectional_iterator_tag| - -#include - // for |min|, |copy| - - -#ifdef HAVE_CPP_NAMESPACE_STD -using std::bidirectional_iterator_tag; -#endif - /* This file defines the abstract interfaces |nsAReadableString| and |nsAReadableCString| (the 'A' is for 'abstract', as opposed to the 'I' in @@ -87,14 +76,14 @@ template class basic_nsAWritableString; template class nsReadingIterator - : public bidirectional_iterator_tag +// : public bidirectional_iterator_tag { public: typedef ptrdiff_t difference_type; typedef CharT value_type; typedef const CharT* pointer; typedef const CharT& reference; - typedef bidirectional_iterator_tag iterator_category; +// typedef bidirectional_iterator_tag iterator_category; private: friend class basic_nsAReadableString; diff --git a/mozilla/xpcom/ds/nsAWritableString.h b/mozilla/xpcom/ds/nsAWritableString.h index c1ecf414948..21fd709a863 100644 --- a/mozilla/xpcom/ds/nsAWritableString.h +++ b/mozilla/xpcom/ds/nsAWritableString.h @@ -48,14 +48,14 @@ template class basic_nsAWritableString; template class nsWritingIterator - : public bidirectional_iterator_tag +// : public bidirectional_iterator_tag { public: typedef ptrdiff_t difference_type; typedef CharT value_type; typedef CharT* pointer; typedef CharT& reference; - typedef bidirectional_iterator_tag iterator_category; +// typedef bidirectional_iterator_tag iterator_category; private: friend class basic_nsAWritableString; diff --git a/mozilla/xpcom/string/public/nsAReadableString.h b/mozilla/xpcom/string/public/nsAReadableString.h index 8468929d402..4defc3e415c 100644 --- a/mozilla/xpcom/string/public/nsAReadableString.h +++ b/mozilla/xpcom/string/public/nsAReadableString.h @@ -35,17 +35,6 @@ #include "nsCharTraits.h" #endif -#include - // for |bidirectional_iterator_tag| - -#include - // for |min|, |copy| - - -#ifdef HAVE_CPP_NAMESPACE_STD -using std::bidirectional_iterator_tag; -#endif - /* This file defines the abstract interfaces |nsAReadableString| and |nsAReadableCString| (the 'A' is for 'abstract', as opposed to the 'I' in @@ -87,14 +76,14 @@ template class basic_nsAWritableString; template class nsReadingIterator - : public bidirectional_iterator_tag +// : public bidirectional_iterator_tag { public: typedef ptrdiff_t difference_type; typedef CharT value_type; typedef const CharT* pointer; typedef const CharT& reference; - typedef bidirectional_iterator_tag iterator_category; +// typedef bidirectional_iterator_tag iterator_category; private: friend class basic_nsAReadableString; diff --git a/mozilla/xpcom/string/public/nsAWritableString.h b/mozilla/xpcom/string/public/nsAWritableString.h index c1ecf414948..21fd709a863 100644 --- a/mozilla/xpcom/string/public/nsAWritableString.h +++ b/mozilla/xpcom/string/public/nsAWritableString.h @@ -48,14 +48,14 @@ template class basic_nsAWritableString; template class nsWritingIterator - : public bidirectional_iterator_tag +// : public bidirectional_iterator_tag { public: typedef ptrdiff_t difference_type; typedef CharT value_type; typedef CharT* pointer; typedef CharT& reference; - typedef bidirectional_iterator_tag iterator_category; +// typedef bidirectional_iterator_tag iterator_category; private: friend class basic_nsAWritableString;