Bug 706010 - Remove NS_SPECIALIZE_TEMPLATE and HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX; r=khuey a=cleanup/removal
authorAndrew Quartey <andrew.quartey@gmail.com>
Tue, 13 Dec 2011 14:17:59 +0000
changeset 84129 d401db5bf9136ddc929fb280cc0af5f874b9d78b
parent 84128 15a6c19a0d23f7e8e1c6765eb87ae52a650dc258
child 84130 cd1caaec767cfb3b27468fcbf3143409dbf5572a
push id519
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 00:38:35 +0000
treeherdermozilla-beta@788ea1ef610b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey, cleanup, removal
bugs706010
milestone11.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 706010 - Remove NS_SPECIALIZE_TEMPLATE and HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX; r=khuey a=cleanup/removal
configure.in
content/base/src/nsContentUtils.cpp
content/base/src/nsXMLNameSpaceMap.cpp
content/media/webm/nsWebMReader.cpp
gfx/layers/basic/BasicLayers.h
gfx/thebes/gfxFontconfigUtils.h
gfx/thebes/gfxPangoFonts.cpp
hal/linux/UPowerClient.cpp
js/src/configure.in
js/xpconnect/src/nsDOMQS.h
layout/style/nsRuleNode.cpp
parser/htmlparser/public/nsScannerString.h
xpcom/base/nsTraceRefcntImpl.cpp
xpcom/base/nscore.h
xpcom/glue/nsCOMPtr.h
xpcom/string/public/nsCharTraits.h
xpcom/string/src/nsStringObsolete.cpp
xpcom/xpcom-config.h.in
--- a/configure.in
+++ b/configure.in
@@ -3972,20 +3972,19 @@ AC_CACHE_CHECK(for modern C++ template s
                ac_cv_cpp_modern_specialize_template_syntax,
                [AC_TRY_COMPILE(template <class T> struct X { int a; };
                                class Y {};
                                template <> struct X<Y> { double a; };,
                                X<int> int_x;
                                X<Y> y_x;,
                                ac_cv_cpp_modern_specialize_template_syntax=yes,
                                ac_cv_cpp_modern_specialize_template_syntax=no)])
-if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
-  AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
-fi
-
+if test "$ac_cv_cpp_modern_specialize_template_syntax" = no ; then
+  AC_MSG_ERROR([The C++ compiler does not support template specialization])
+fi
 
 dnl Some compilers support only full specialization, and some don't.
 AC_CACHE_CHECK(whether partial template specialization works,
                ac_cv_cpp_partial_specialization,
                [AC_TRY_COMPILE(template <class T> class Foo {};
                                template <class T> class Foo<T*> {};,
                                return 0;,
                                ac_cv_cpp_partial_specialization=yes,
@@ -8775,17 +8774,16 @@ dnl ====================================
 
 dnl The following defines are used by xpcom
 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
 CPP_THROW_NEW
 HAVE_CPP_2BYTE_WCHAR_T
 HAVE_CPP_AMBIGUITY_RESOLVING_USING
 HAVE_CPP_CHAR16_T
 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
-HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
 HAVE_CPP_PARTIAL_SPECIALIZATION
 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
 HAVE_STATVFS
 NEED_CPP_UNUSED_IMPLEMENTATIONS
 NEW_H
 HAVE_GETPAGESIZE
 HAVE_ICONV
 HAVE_ICONV_WITH_CONST_INPUT
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -751,32 +751,32 @@ struct NormalizeNewlinesCharTraits<CharT
     }
 
   private:
     CharT* mCharPtr;
 };
 
 #else
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct NormalizeNewlinesCharTraits<char*> {
   public:
     typedef char value_type;
 
   public:
     NormalizeNewlinesCharTraits(char* aCharPtr) : mCharPtr(aCharPtr) { }
     void writechar(char aChar) {
       *mCharPtr++ = aChar;
     }
 
   private:
     char* mCharPtr;
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct NormalizeNewlinesCharTraits<PRUnichar*> {
   public:
     typedef PRUnichar value_type;
 
   public:
     NormalizeNewlinesCharTraits(PRUnichar* aCharPtr) : mCharPtr(aCharPtr) { }
     void writechar(PRUnichar aChar) {
       *mCharPtr++ = aChar;
--- a/content/base/src/nsXMLNameSpaceMap.cpp
+++ b/content/base/src/nsXMLNameSpaceMap.cpp
@@ -40,25 +40,25 @@
  * A class for keeping track of prefix-to-namespace-id mappings
  */
 
 #include "nsXMLNameSpaceMap.h"
 #include "nsINameSpaceManager.h"
 #include "nsContentUtils.h"
 #include "nsGkAtoms.h"
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsDefaultComparator <nsNameSpaceEntry, nsIAtom*> {
   public:
     bool Equals(const nsNameSpaceEntry& aEntry, nsIAtom* const& aPrefix) const {
       return aEntry.prefix == aPrefix;
     }
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsDefaultComparator <nsNameSpaceEntry, PRInt32> {
   public:
     bool Equals(const nsNameSpaceEntry& aEntry, const PRInt32& aNameSpace) const {
       return aEntry.nameSpaceID == aNameSpace;
     }
 };
 
 
--- a/content/media/webm/nsWebMReader.cpp
+++ b/content/media/webm/nsWebMReader.cpp
@@ -67,17 +67,17 @@ extern PRLogModuleInfo* gBuiltinDecoderL
 static const unsigned NS_PER_USEC = 1000;
 static const double NS_PER_S = 1e9;
 
 // If a seek request is within SEEK_DECODE_MARGIN microseconds of the
 // current time, decode ahead from the current frame rather than performing
 // a full seek.
 static const int SEEK_DECODE_MARGIN = 250000;
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsAutoRefTraits<NesteggPacketHolder> : public nsPointerRefTraits<NesteggPacketHolder>
 {
 public:
   static void Release(NesteggPacketHolder* aHolder) { delete aHolder; }
 };
 
 // Functions for reading and seeking using nsMediaStream required for
 // nestegg_io. The 'user data' passed to these functions is the
--- a/gfx/layers/basic/BasicLayers.h
+++ b/gfx/layers/basic/BasicLayers.h
@@ -284,17 +284,17 @@ private:
  * 
  * We use nsCountedRef<nsMainThreadSurfaceRef> to reference the
  * gfxASurface. When AddRefing, we assert that we're on the main thread.
  * When Releasing, if we're not on the main thread, we post an event to
  * the main thread to do the actual release.
  */
 class nsMainThreadSurfaceRef;
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsAutoRefTraits<nsMainThreadSurfaceRef> {
 public:
   typedef gfxASurface* RawRef;
 
   /**
    * The XPCOM event that will do the actual release on the main thread.
    */
   class SurfaceReleaser : public nsRunnable {
--- a/gfx/thebes/gfxFontconfigUtils.h
+++ b/gfx/thebes/gfxFontconfigUtils.h
@@ -44,32 +44,32 @@
 #include "nsAutoRef.h"
 #include "nsTArray.h"
 #include "nsTHashtable.h"
 #include "nsISupportsImpl.h"
 
 #include <fontconfig/fontconfig.h>
 
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsAutoRefTraits<FcPattern> : public nsPointerRefTraits<FcPattern>
 {
 public:
     static void Release(FcPattern *ptr) { FcPatternDestroy(ptr); }
     static void AddRef(FcPattern *ptr) { FcPatternReference(ptr); }
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsAutoRefTraits<FcFontSet> : public nsPointerRefTraits<FcFontSet>
 {
 public:
     static void Release(FcFontSet *ptr) { FcFontSetDestroy(ptr); }
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsAutoRefTraits<FcCharSet> : public nsPointerRefTraits<FcCharSet>
 {
 public:
     static void Release(FcCharSet *ptr) { FcCharSetDestroy(ptr); }
 };
 
 class gfxIgnoreCaseCStringComparator
 {
--- a/gfx/thebes/gfxPangoFonts.cpp
+++ b/gfx/thebes/gfxPangoFonts.cpp
@@ -130,20 +130,20 @@ static FT_Library gFTLibrary;
 
 template <class T>
 class gfxGObjectRefTraits : public nsPointerRefTraits<T> {
 public:
     static void Release(T *aPtr) { g_object_unref(aPtr); }
     static void AddRef(T *aPtr) { g_object_ref(aPtr); }
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsAutoRefTraits<PangoFont> : public gfxGObjectRefTraits<PangoFont> { };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsAutoRefTraits<PangoCoverage>
     : public nsPointerRefTraits<PangoCoverage> {
 public:
     static void Release(PangoCoverage *aPtr) { pango_coverage_unref(aPtr); }
     static void AddRef(PangoCoverage *aPtr) { pango_coverage_ref(aPtr); }
 };
 
 
--- a/hal/linux/UPowerClient.cpp
+++ b/hal/linux/UPowerClient.cpp
@@ -43,24 +43,24 @@
 
 /*
  * Helper that manages the destruction of glib objects as soon as they leave
  * the current scope.
  *
  * We are specializing nsAutoRef class.
  */
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsAutoRefTraits<DBusGProxy> : public nsPointerRefTraits<DBusGProxy>
 {
 public:
   static void Release(DBusGProxy* ptr) { g_object_unref(ptr); }
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsAutoRefTraits<GHashTable> : public nsPointerRefTraits<GHashTable>
 {
 public:
   static void Release(GHashTable* ptr) { g_hash_table_unref(ptr); }
 };
 
 using namespace mozilla::dom::battery;
 
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -3698,21 +3698,20 @@ AC_CACHE_CHECK(for modern C++ template s
                ac_cv_cpp_modern_specialize_template_syntax,
                [AC_TRY_COMPILE(template <class T> struct X { int a; };
                                class Y {};
                                template <> struct X<Y> { double a; };,
                                X<int> int_x;
                                X<Y> y_x;,
                                ac_cv_cpp_modern_specialize_template_syntax=yes,
                                ac_cv_cpp_modern_specialize_template_syntax=no)])
-if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
-  AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
+if test "$ac_cv_cpp_modern_specialize_template_syntax" = no ; then
+  AC_MSG_ERROR([The C++ compiler does not support template specialization])
 fi
 
-
 dnl Some compilers support only full specialization, and some don't.
 AC_CACHE_CHECK(whether partial template specialization works,
                ac_cv_cpp_partial_specialization,
                [AC_TRY_COMPILE(template <class T> class Foo {};
                                template <class T> class Foo<T*> {};,
                                return 0;,
                                ac_cv_cpp_partial_specialization=yes,
                                ac_cv_cpp_partial_specialization=no)])
--- a/js/xpconnect/src/nsDOMQS.h
+++ b/js/xpconnect/src/nsDOMQS.h
@@ -35,17 +35,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsDOMQS_h__
 #define nsDOMQS_h__
 
 #include "nsDOMClassInfoID.h"
 
 #define DEFINE_UNWRAP_CAST(_interface, _base, _bit)                           \
-NS_SPECIALIZE_TEMPLATE                                                        \
+template <>                                                                   \
 inline JSBool                                                                 \
 xpc_qsUnwrapThis<_interface>(JSContext *cx,                                   \
                              JSObject *obj,                                   \
                              JSObject *callee,                                \
                              _interface **ppThis,                             \
                              nsISupports **pThisRef,                          \
                              jsval *pThisVal,                                 \
                              XPCLazyCallContext *lccx,                        \
@@ -57,17 +57,17 @@ xpc_qsUnwrapThis<_interface>(JSContext *
                                                 &rv);                         \
     *ppThis = NULL;  /* avoids uninitialized warnings in callers */           \
     if (failureFatal && !native)                                              \
         return xpc_qsThrow(cx, rv);                                           \
     *ppThis = static_cast<_interface*>(static_cast<_base*>(native));          \
     return true;                                                              \
 }                                                                             \
                                                                               \
-NS_SPECIALIZE_TEMPLATE                                                        \
+template <>                                                                   \
 inline nsresult                                                               \
 xpc_qsUnwrapArg<_interface>(JSContext *cx,                                    \
                             jsval v,                                          \
                             _interface **ppArg,                               \
                             nsISupports **ppArgRef,                           \
                             jsval *vp)                                        \
 {                                                                             \
     nsresult rv;                                                              \
@@ -99,17 +99,17 @@ castToElement(nsIContent *content, jsval
 {
     if (!content->IsElement())
         return false;
     *ppInterface = static_cast<nsGenericElement*>(content->AsElement());
     *pVal = val;
     return true;
 }
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 inline JSBool
 xpc_qsUnwrapThis<nsGenericElement>(JSContext *cx,
                                    JSObject *obj,
                                    JSObject *callee,
                                    nsGenericElement **ppThis,
                                    nsISupports **pThisRef,
                                    jsval *pThisVal,
                                    XPCLazyCallContext *lccx,
@@ -130,17 +130,17 @@ xpc_qsUnwrapThis<nsGenericElement>(JSCon
     if (!failureFatal && (!ok || !content)) {
       ok = true;
       *ppThis = nsnull;
     }
 
     return ok;
 }
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 inline nsresult
 xpc_qsUnwrapArg<nsGenericElement>(JSContext *cx,
                                   jsval v,
                                   nsGenericElement **ppArg,
                                   nsISupports **ppArgRef,
                                   jsval *vp)
 {
     nsIContent *content;
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -4739,48 +4739,48 @@ nsRuleNode::ComputeColorData(void* aStar
   COMPUTE_END_INHERITED(Color, color)
 }
 
 // information about how to compute values for background-* properties
 template <class SpecifiedValueItem>
 struct InitialInheritLocationFor {
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct InitialInheritLocationFor<nsCSSValueList> {
   static nsCSSValue nsCSSValueList::* Location() {
     return &nsCSSValueList::mValue;
   }
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct InitialInheritLocationFor<nsCSSValuePairList> {
   static nsCSSValue nsCSSValuePairList::* Location() {
     return &nsCSSValuePairList::mXValue;
   }
 };
 
 template <class SpecifiedValueItem, class ComputedValueItem>
 struct BackgroundItemComputer {
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct BackgroundItemComputer<nsCSSValueList, PRUint8>
 {
   static void ComputeValue(nsStyleContext* aStyleContext,
                            const nsCSSValueList* aSpecifiedValue,
                            PRUint8& aComputedValue,
                            bool& aCanStoreInRuleTree)
   {
     SetDiscrete(aSpecifiedValue->mValue, aComputedValue, aCanStoreInRuleTree,
                 SETDSC_ENUMERATED, PRUint8(0), 0, 0, 0, 0, 0);
   }
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct BackgroundItemComputer<nsCSSValueList, nsStyleImage>
 {
   static void ComputeValue(nsStyleContext* aStyleContext,
                            const nsCSSValueList* aSpecifiedValue,
                            nsStyleImage& aComputedValue,
                            bool& aCanStoreInRuleTree)
   {
     SetStyleImage(aStyleContext, aSpecifiedValue->mValue, aComputedValue,
@@ -4796,17 +4796,17 @@ struct BackgroundPositionAxis {
 
 static const BackgroundPositionAxis gBGPosAxes[] = {
   { &nsCSSValuePairList::mXValue,
     &nsStyleBackground::Position::mXPosition },
   { &nsCSSValuePairList::mYValue,
     &nsStyleBackground::Position::mYPosition }
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct BackgroundItemComputer<nsCSSValuePairList, nsStyleBackground::Position>
 {
   static void ComputeValue(nsStyleContext* aStyleContext,
                            const nsCSSValuePairList* aSpecifiedValue,
                            nsStyleBackground::Position& aComputedValue,
                            bool& aCanStoreInRuleTree)
   {
     nsStyleBackground::Position &position = aComputedValue;
@@ -4858,17 +4858,17 @@ static const BackgroundSizeAxis gBGSizeA
   { &nsCSSValuePairList::mXValue,
     &nsStyleBackground::Size::mWidth,
     &nsStyleBackground::Size::mWidthType },
   { &nsCSSValuePairList::mYValue,
     &nsStyleBackground::Size::mHeight,
     &nsStyleBackground::Size::mHeightType }
 };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct BackgroundItemComputer<nsCSSValuePairList, nsStyleBackground::Size>
 {
   static void ComputeValue(nsStyleContext* aStyleContext,
                            const nsCSSValuePairList* aSpecifiedValue,
                            nsStyleBackground::Size& aComputedValue,
                            bool& aCanStoreInRuleTree)
   {
     nsStyleBackground::Size &size = aComputedValue;
--- a/parser/htmlparser/public/nsScannerString.h
+++ b/parser/htmlparser/public/nsScannerString.h
@@ -477,17 +477,17 @@ SameFragment( const nsScannerIterator& a
   {
     return a.fragment().mFragmentStart == b.fragment().mFragmentStart;
   }
 
 
   /**
    * this class is needed in order to make use of the methods in nsAlgorithm.h
    */
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct nsCharSourceTraits<nsScannerIterator>
   {
     typedef nsScannerIterator::difference_type difference_type;
 
     static
     PRUint32
     readable_distance( const nsScannerIterator& first, const nsScannerIterator& last )
       {
--- a/xpcom/base/nsTraceRefcntImpl.cpp
+++ b/xpcom/base/nsTraceRefcntImpl.cpp
@@ -490,17 +490,17 @@ static PRIntn DumpSerialNumbers(PLHashEn
                             record->serialNumber,
                             NS_INT32_TO_PTR(aHashEntry->key),
                             record->refCount);
 #endif
   return HT_ENUMERATE_NEXT;
 }
 
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsDefaultComparator <BloatEntry*, BloatEntry*> {
   public:
     bool Equals(BloatEntry* const& aA, BloatEntry* const& aB) const {
       return PL_strcmp(aA->GetClassName(), aB->GetClassName()) == 0;
     }
     bool LessThan(BloatEntry* const& aA, BloatEntry* const& aB) const {
       return PL_strcmp(aA->GetClassName(), aB->GetClassName()) < 0;
     }
--- a/xpcom/base/nscore.h
+++ b/xpcom/base/nscore.h
@@ -379,49 +379,34 @@ typedef PRUint32 nsrefcnt;
 #endif
 
 
 #include "nsError.h"
 
 /* ------------------------------------------------------------------------ */
 /* Casting macros for hiding C++ features from older compilers */
 
-  /*
-    All our compiler support template specialization, but not all support the
-    |template <>| notation.  The compiler that don't understand this notation
-    just omit it for specialization.
-
-    Need to add an autoconf test for this.
-  */
-
   /* under VC++ (Windows), we don't have autoconf yet */
 #if defined(_MSC_VER) && (_MSC_VER>=1100)
-  #define HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
   #define HAVE_CPP_2BYTE_WCHAR_T
 #endif
 
 #ifndef __PRUNICHAR__
 #define __PRUNICHAR__
   /* For now, don't use wchar_t on Unix because it breaks the Netscape
    * commercial build.  When this is fixed there will be no need for the
    * |reinterpret_cast| in nsLiteralString.h either.
    */
   #if defined(HAVE_CPP_2BYTE_WCHAR_T) && defined(NS_WIN32)
     typedef wchar_t PRUnichar;
   #else
     typedef PRUint16 PRUnichar;
   #endif
 #endif
 
-#ifdef HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
-  #define NS_SPECIALIZE_TEMPLATE  template <>
-#else
-  #define NS_SPECIALIZE_TEMPLATE
-#endif
-
 /*
  * Use these macros to do 64bit safe pointer conversions.
  */
 
 #define NS_PTR_TO_INT32(x)  ((PRInt32)  (PRWord) (x))
 #define NS_PTR_TO_UINT32(x) ((PRUint32) (PRWord) (x))
 #define NS_INT32_TO_PTR(x)  ((void *)   (PRWord) (x))
 
--- a/xpcom/glue/nsCOMPtr.h
+++ b/xpcom/glue/nsCOMPtr.h
@@ -889,17 +889,17 @@ class nsCOMPtr MOZ_FINAL
     Specializing |nsCOMPtr| for |nsISupports| allows us to use |nsCOMPtr<nsISupports>| the
     same way people use |nsISupports*| and |void*|, i.e., as a `catch-all' pointer pointing
     to any valid [XP]COM interface.  Otherwise, an |nsCOMPtr<nsISupports>| would only be able
     to point to the single [XP]COM-correct |nsISupports| instance within an object; extra
     querying ensues.  Clients need to be able to pass around arbitrary interface pointers,
     without hassles, through intermediary code that doesn't know the exact type.
   */
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsCOMPtr<nsISupports>
     : private nsCOMPtr_base
   {
     public:
       typedef nsISupports element_type;
 
         // Constructors
 
@@ -1360,17 +1360,17 @@ class nsGetterAddRefs
           return *(mTargetSmartPtr.StartAssignment());
         }
 
     private:
       nsCOMPtr<T>& mTargetSmartPtr;
   };
 
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 class nsGetterAddRefs<nsISupports>
   {
     public:
       explicit
       nsGetterAddRefs( nsCOMPtr<nsISupports>& aSmartPtr )
           : mTargetSmartPtr(aSmartPtr)
         {
           // nothing else to do
--- a/xpcom/string/public/nsCharTraits.h
+++ b/xpcom/string/public/nsCharTraits.h
@@ -133,17 +133,17 @@
 #define UCS2_REPLACEMENT_CHAR PRUnichar(0xFFFD)
 
 #define UCS_END PRUint32(0x00110000)
 #define IS_VALID_CHAR(c) ((PRUint32(c) < UCS_END) && !IS_SURROGATE(c))
 #define ENSURE_VALID_CHAR(c) (IS_VALID_CHAR(c) ? (c) : UCS2_REPLACEMENT_CHAR)
 
 template <class CharT> struct nsCharTraits {};
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct nsCharTraits<PRUnichar>
   {
     typedef PRUnichar char_type;
     typedef PRUint16  unsigned_char_type;
     typedef char      incompatible_char_type;
 
     static char_type *sEmptyBuffer;
 
@@ -423,17 +423,17 @@ struct nsCharTraits<PRUnichar>
       {
         return eq_int_type(c, eof()) ? ~eof() : c;
       }
 
     // static state_type get_state( pos_type );
 #endif
   };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct nsCharTraits<char>
   {
     typedef char           char_type;
     typedef unsigned char  unsigned_char_type;
     typedef PRUnichar      incompatible_char_type;
 
     static char_type *sEmptyBuffer;
 
@@ -717,17 +717,17 @@ struct nsCharSourceTraits<CharT*>
     advance( CharT*& s, difference_type n )
       {
         s += n;
       }
   };
 
 #else
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct nsCharSourceTraits<const char*>
   {
     typedef ptrdiff_t difference_type;
 
     static
     PRUint32
     readable_distance( const char* s )
       {
@@ -753,17 +753,17 @@ struct nsCharSourceTraits<const char*>
     void
     advance( const char*& s, difference_type n )
       {
         s += n;
       }
  };
 
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct nsCharSourceTraits<const PRUnichar*>
   {
     typedef ptrdiff_t difference_type;
 
     static
     PRUint32
     readable_distance( const PRUnichar* s )
       {
@@ -818,29 +818,29 @@ struct nsCharSinkTraits<CharT*>
       {
         nsCharTraits<CharT>::move(iter, s, n);
         iter += n;
       }
   };
 
 #else
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct nsCharSinkTraits<char*>
   {
     static
     void
     write( char*& iter, const char* s, PRUint32 n )
       {
         nsCharTraits<char>::move(iter, s, n);
         iter += n;
       }
   };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct nsCharSinkTraits<PRUnichar*>
   {
     static
     void
     write( PRUnichar*& iter, const PRUnichar* s, PRUint32 n )
       {
         nsCharTraits<PRUnichar>::move(iter, s, n);
         iter += n;
--- a/xpcom/string/src/nsStringObsolete.cpp
+++ b/xpcom/string/src/nsStringObsolete.cpp
@@ -588,17 +588,17 @@ GetFindInSetFilter( const CharT* set)
       ++set;
     }
     return filter;
   }
 
 // This template class is used by our code to access rickg's buffer routines.
 template <class CharT> struct nsBufferRoutines {};
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct nsBufferRoutines<char>
   {
     static
     PRInt32 compare( const char* a, const char* b, PRUint32 max, bool ic )
       {
         return Compare1To1(a, b, max, ic);
       }
 
@@ -634,17 +634,17 @@ struct nsBufferRoutines<char>
 
     static
     PRInt32 compress_chars( char* s, PRUint32 len, const char* set ) 
       {
         return CompressChars1(s, len, set);
       }
   };
 
-NS_SPECIALIZE_TEMPLATE
+template <>
 struct nsBufferRoutines<PRUnichar>
   {
     static
     PRInt32 compare( const PRUnichar* a, const PRUnichar* b, PRUint32 max, bool ic )
       {
         NS_ASSERTION(!ic, "no case-insensitive compare here");
         return Compare2To2(a, b, max);
       }
--- a/xpcom/xpcom-config.h.in
+++ b/xpcom/xpcom-config.h.in
@@ -15,21 +15,16 @@
 #undef HAVE_CPP_AMBIGUITY_RESOLVING_USING
 
 /* Define if the c++ compiler supports char16_t */
 #undef HAVE_CPP_CHAR16_T
 
 /* Define if a dyanmic_cast to void* gives the most derived object */
 #undef HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
 
-/* Define if the c++ compiler supports the modern template 
- * specialization syntax 
- */
-#undef HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
-
 /* Define if the c++ compiler supports partial template specialization */
 #undef HAVE_CPP_PARTIAL_SPECIALIZATION
 
 /* Define if the c++ compiler has trouble comparing a constant
  * reference to a templatized class to zero
  */
 #undef HAVE_CPP_TROUBLE_COMPARING_TO_ZERO