From a408871292be534621037cd13b7c666aa7df225d Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Mon, 31 Mar 2003 21:30:33 +0000 Subject: [PATCH] Use an autoconf test to set HAVE_CPP_TYPENAME. (fix bustage on newer versions of the IRIX native compiler) b=199625 r=bbaetz sr=brendan a=asa --- configure.in | 22 ++++++++++++++++++++++ xpcom/base/nscore.h | 9 --------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index e60d6c5da65f..76089aa0766b 100644 --- a/configure.in +++ b/configure.in @@ -2510,6 +2510,28 @@ if test "$ac_cv_cpp_explicit" = yes ; then AC_DEFINE(HAVE_CPP_EXPLICIT) fi +AC_CACHE_CHECK(for C++ \"typename\" keyword, + ac_cv_cpp_typename, + [AC_TRY_COMPILE(class param { + public: + typedef unsigned long num_type; + }; + + template class tplt { + public: + typedef typename T::num_type t_num_type; + t_num_type foo(typename T::num_type num) { + return num; + } + };, + tplt A; + A.foo(0);, + ac_cv_cpp_typename=yes, + ac_cv_cpp_typename=no)]) +if test "$ac_cv_cpp_typename" = yes ; then + AC_DEFINE(HAVE_CPP_TYPENAME) +fi + dnl Check for support of modern template specialization syntax dnl Test code and requirement from scc@netscape.com. dnl Autoconf cut-and-paste job by waterson@netscape.com diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h index 439bc3dce857..0f019ad09741 100644 --- a/xpcom/base/nscore.h +++ b/xpcom/base/nscore.h @@ -215,15 +215,6 @@ typedef PRUint32 nsresult; #define HAVE_CPP_2BYTE_WCHAR_T #endif - /* until we get an autoconf test for this, we'll assume it's on (since we're using it already) */ -#define HAVE_CPP_TYPENAME - - /* waiting to find out if OS/2 VisualAge participates in autoconf */ -#if defined(XP_OS2_VACPP) || defined(AIX_XLC_364) || (defined(IRIX) && !defined(__GNUC__)) - #undef HAVE_CPP_TYPENAME -#endif - - #ifndef __PRUNICHAR__ #define __PRUNICHAR__ /* For now, don't use wchar_t on Unix because it breaks the Netscape