Add CPP_THROW_NEW macro to the build system. This macro should be used when def

ining a local |operator new| function.  It will be set to an empty throw functio
n by default on all platforms except mac CW builds.  This will allow us to not c
rash on systems that expect |operator new| to throw an exception by default and
will suppress compiler warnings about how |operator new| should throw an excepti
on instead of returning NULL.
Bug 149032 r=timeless sr=scc
This commit is contained in:
seawood%netscape.com 2002-07-02 20:26:10 +00:00
Родитель 8f6f1756ce
Коммит 5c19b76a13
2 изменённых файлов: 44 добавлений и 24 удалений

59
configure поставляемый
Просмотреть файл

@ -12487,6 +12487,7 @@ if test "${enable_cpp_rtti+set}" = set; then
fi
_MOZ_CPP_EXCEPTIONS=
# Check whether --enable-cpp-exceptions or --disable-cpp-exceptions was given.
if test "${enable_cpp_exceptions+set}" = set; then
enableval="$enable_cpp_exceptions"
@ -12495,7 +12496,8 @@ if test "${enable_cpp_exceptions+set}" = set; then
_MOZ_EXCEPTIONS_FLAGS=-LANG:exceptions=ON
else
_MOZ_EXCEPTIONS_FLAGS=-fexceptions
fi
fi
_MOZ_CPP_EXCEPTIONS=1
elif test "$enableval" = "no"; then
:
else
@ -12504,6 +12506,17 @@ fi
fi
if test "$_MOZ_CPP_EXCEPTIONS"; then
cat >> confdefs.h <<\EOF
#define CPP_THROW_NEW
EOF
else
cat >> confdefs.h <<\EOF
#define CPP_THROW_NEW throw()
EOF
fi
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
@ -12666,7 +12679,7 @@ case "$target" in
# Extract the first word of "makeC++SharedLib_r", so it can be a program name with args.
set dummy makeC++SharedLib_r; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:12670: checking for $ac_word" >&5
echo "configure:12683: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_AIX_SHLIB_BIN'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -12850,7 +12863,7 @@ fi
# Extract the first word of "glib-config", so it can be a program name with args.
set dummy glib-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:12854: checking for $ac_word" >&5
echo "configure:12867: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -12885,7 +12898,7 @@ fi
min_glib_version=1.2.0
echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6
echo "configure:12889: checking for GLIB - version >= $min_glib_version" >&5
echo "configure:12902: checking for GLIB - version >= $min_glib_version" >&5
no_glib=""
if test "$GLIB_CONFIG" = "no" ; then
no_glib=yes
@ -12908,7 +12921,7 @@ echo "configure:12889: checking for GLIB - version >= $min_glib_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
#line 12912 "configure"
#line 12925 "configure"
#include "confdefs.h"
#include <glib.h>
@ -12984,7 +12997,7 @@ main ()
}
EOF
if { (eval echo configure:12988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:13001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@ -13018,7 +13031,7 @@ fi
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
cat > conftest.$ac_ext <<EOF
#line 13022 "configure"
#line 13035 "configure"
#include "confdefs.h"
#include <glib.h>
@ -13028,7 +13041,7 @@ int main() {
return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
; return 0; }
EOF
if { (eval echo configure:13032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:13045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
@ -13072,7 +13085,7 @@ rm -f conftest*
# Extract the first word of "libIDL-config", so it can be a program name with args.
set dummy libIDL-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:13076: checking for $ac_word" >&5
echo "configure:13089: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_LIBIDL_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -13107,7 +13120,7 @@ fi
min_libIDL_version=$LIBIDL_VERSION
echo $ac_n "checking for libIDL - version >= $min_libIDL_version""... $ac_c" 1>&6
echo "configure:13111: checking for libIDL - version >= $min_libIDL_version" >&5
echo "configure:13124: checking for libIDL - version >= $min_libIDL_version" >&5
no_libIDL=""
if test "$LIBIDL_CONFIG" = "no" ; then
no_libIDL=yes
@ -13134,7 +13147,7 @@ echo "configure:13111: checking for libIDL - version >= $min_libIDL_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
#line 13138 "configure"
#line 13151 "configure"
#include "confdefs.h"
#include <stdio.h>
@ -13220,7 +13233,7 @@ main ()
}
EOF
if { (eval echo configure:13224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:13237: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@ -13254,7 +13267,7 @@ fi
CFLAGS="$CFLAGS $LIBIDL_CFLAGS"
LIBS="$LIBS $LIBIDL_LIBS"
cat > conftest.$ac_ext <<EOF
#line 13258 "configure"
#line 13271 "configure"
#include "confdefs.h"
#include <stdio.h>
@ -13265,7 +13278,7 @@ int main() {
return IDL_get_libver_string ? 1 : 0;
; return 0; }
EOF
if { (eval echo configure:13269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:13282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding libIDL or finding the wrong"
@ -13304,7 +13317,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:13308: checking for $ac_word" >&5
echo "configure:13321: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_ORBIT_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -13430,7 +13443,7 @@ fi
# Extract the first word of "glib-config", so it can be a program name with args.
set dummy glib-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:13434: checking for $ac_word" >&5
echo "configure:13447: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -13465,7 +13478,7 @@ fi
min_glib_version=${GLIB_VERSION}
echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6
echo "configure:13469: checking for GLIB - version >= $min_glib_version" >&5
echo "configure:13482: checking for GLIB - version >= $min_glib_version" >&5
no_glib=""
if test "$GLIB_CONFIG" = "no" ; then
no_glib=yes
@ -13488,7 +13501,7 @@ echo "configure:13469: checking for GLIB - version >= $min_glib_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
#line 13492 "configure"
#line 13505 "configure"
#include "confdefs.h"
#include <glib.h>
@ -13564,7 +13577,7 @@ main ()
}
EOF
if { (eval echo configure:13568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:13581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@ -13598,7 +13611,7 @@ fi
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
cat > conftest.$ac_ext <<EOF
#line 13602 "configure"
#line 13615 "configure"
#include "confdefs.h"
#include <glib.h>
@ -13608,7 +13621,7 @@ int main() {
return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
; return 0; }
EOF
if { (eval echo configure:13612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:13625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
@ -13665,14 +13678,14 @@ fi
_SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $GLIB_CFLAGS"
cat > conftest.$ac_ext <<EOF
#line 13669 "configure"
#line 13682 "configure"
#include "confdefs.h"
#include <gmodule.h>
int main() {
int x = 1; x++;
; return 0; }
EOF
if { (eval echo configure:13676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:13689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
echo "configure: failed program was:" >&5

Просмотреть файл

@ -4022,14 +4022,21 @@ dnl ========================================================
dnl C++ exceptions (g++/egcs only - for now)
dnl Should be smarter and check that the compiler does indeed have exceptions
dnl ========================================================
_MOZ_CPP_EXCEPTIONS=
MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
[ --enable-cpp-exceptions Enable C++ exceptions ],
[ if test "$MIPSPRO_CXX"; then
_MOZ_EXCEPTIONS_FLAGS=-LANG:exceptions=ON
else
_MOZ_EXCEPTIONS_FLAGS=-fexceptions
fi ])
fi
_MOZ_CPP_EXCEPTIONS=1 ])
if test "$_MOZ_CPP_EXCEPTIONS"; then
AC_DEFINE(CPP_THROW_NEW, [])
else
AC_DEFINE(CPP_THROW_NEW, [throw()])
fi
AC_LANG_C
dnl ========================================================