From fa91dce42ebb119e646b8755e1f2eaa90aaf72c6 Mon Sep 17 00:00:00 2001 From: "scc%netscape.com" Date: Sat, 13 May 2000 23:59:49 +0000 Subject: [PATCH] waterson and I are giving up on the current build being allowed to even include files related to STL, mostly (but not only) because of Solaris ... by the time someone want to _use_ STL, maybe the compilers will be better, and this fix won't effect them. git-svn-id: svn://10.0.0.236/trunk@69597 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/public/nsAReadableString.h | 15 ++------- mozilla/string/public/nsAWritableString.h | 4 +-- mozilla/xpcom/base/nscore.h | 33 ++++++++++--------- mozilla/xpcom/ds/nsAReadableString.h | 15 ++------- mozilla/xpcom/ds/nsAWritableString.h | 4 +-- .../xpcom/string/public/nsAReadableString.h | 15 ++------- .../xpcom/string/public/nsAWritableString.h | 4 +-- 7 files changed, 29 insertions(+), 61 deletions(-) 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;