Bug 1120793 - Remove obsolete _Throw wrapping. r=froydnj

This commit is contained in:
Mike Hommey 2015-08-19 15:55:34 +09:00
parent 0756a03abe
commit dea9486c28
6 changed files with 17 additions and 113 deletions

View File

@ -663,66 +663,30 @@ See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
unset _MSVC_VER_FILTER
AC_CACHE_CHECK(for std::_Throw, ac_cv_have_std__Throw,
AC_CACHE_CHECK(for overridable _RAISE,
ac_cv_have__RAISE,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
AC_TRY_COMPILE([#include <exception>],
[std::_Throw(std::exception()); return 0;],
ac_cv_have_std__Throw="yes",
ac_cv_have_std__Throw="no")
AC_TRY_COMPILE([#include <xstddef>
#undef _RAISE
#define _RAISE(x) externallyDefinedFunction((x).what())
#include <vector>
],
[std::vector<int> v; return v.at(1);],
ac_cv_have__RAISE="no",
ac_cv_have__RAISE="yes")
CXXFLAGS="$_SAVE_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_have_std__Throw" = "yes"; then
AC_CACHE_CHECK(for |class __declspec(dllimport) exception| bug,
ac_cv_have_dllimport_exception_bug,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
AC_TRY_LINK([#include <vector>],
[std::vector<int> v; return v.at(1);],
ac_cv_have_dllimport_exception_bug="no",
ac_cv_have_dllimport_exception_bug="yes")
CXXFLAGS="$_SAVE_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_have_dllimport_exception_bug" = "no"; then
WRAP_STL_INCLUDES=1
MOZ_MSVC_STL_WRAP_Throw=1
AC_DEFINE(MOZ_MSVC_STL_WRAP_Throw)
fi
if test "$ac_cv_have__RAISE" = "yes"; then
WRAP_STL_INCLUDES=1
MOZ_MSVC_STL_WRAP_RAISE=1
AC_DEFINE(MOZ_MSVC_STL_WRAP_RAISE)
else
AC_CACHE_CHECK(for overridable _RAISE,
ac_cv_have__RAISE,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
AC_TRY_COMPILE([#include <xstddef>
#undef _RAISE
#define _RAISE(x) externallyDefinedFunction((x).what())
#include <vector>
],
[std::vector<int> v; return v.at(1);],
ac_cv_have__RAISE="no",
ac_cv_have__RAISE="yes")
CXXFLAGS="$_SAVE_CXXFLAGS"
AC_LANG_RESTORE
])
if test "$ac_cv_have__RAISE" = "yes"; then
WRAP_STL_INCLUDES=1
MOZ_MSVC_STL_WRAP_RAISE=1
AC_DEFINE(MOZ_MSVC_STL_WRAP_RAISE)
else
AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.])
fi
AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.])
fi
if test "$WRAP_STL_INCLUDES" = "1"; then
@ -839,7 +803,6 @@ AC_SUBST(INTEL_CXX)
AC_SUBST(STL_FLAGS)
AC_SUBST(WRAP_STL_INCLUDES)
AC_SUBST(MOZ_MSVC_STL_WRAP_Throw)
AC_SUBST(MOZ_MSVC_STL_WRAP_RAISE)
dnl ========================================================

View File

@ -11,25 +11,18 @@ EXPORTS.mozilla += [
'mozalloc_oom.h',
]
if CONFIG['MOZ_MSVC_STL_WRAP_RAISE'] or CONFIG['MOZ_MSVC_STL_WRAP_Throw']:
build_msvc_wrappers = 1
else:
build_msvc_wrappers = 0
if CONFIG['WRAP_STL_INCLUDES']:
if CONFIG['GNU_CXX']:
EXPORTS.mozilla += ['throw_gcc.h']
elif CONFIG['_MSC_VER']:
DEFINES['_HAS_EXCEPTIONS'] = 0
if build_msvc_wrappers:
if CONFIG['MOZ_MSVC_STL_WRAP_RAISE']:
EXPORTS.mozilla += [
'msvc_raise_wrappers.h',
'msvc_throw_wrapper.h',
'throw_msvc.h',
]
SOURCES += [
'msvc_raise_wrappers.cpp',
'msvc_throw_wrapper.cpp',
]
UNIFIED_SOURCES += [

View File

@ -1,26 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include <exception>
#include "mozilla/mozalloc_abort.h"
namespace std {
// NB: user code is not supposed to touch the std:: namespace. We're
// doing this after careful review because we want to define our own
// exception throwing semantics. Don't try this at home!
__declspec(dllexport) void mozilla_Throw(const exception& e);
void
mozilla_Throw(const exception& e)
{
mozalloc_abort(e.what());
}
} // namespace std

View File

@ -1,18 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: sw=4 ts=4 et :
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_msvc_throw_wrapper_h
#define mozilla_msvc_throw_wrapper_h
// Define our own _Throw because the Win2k CRT doesn't export it.
# ifdef _EXCEPTION_
# error "Unable to wrap _Throw(); CRT _Throw() already declared"
# endif
# define _Throw mozilla_Throw
# include <exception>
#endif // ifndef mozilla_msvc_throw_wrapper_h

View File

@ -6,17 +6,11 @@
NO_VISIBILITY_FLAGS = True
if CONFIG['MOZ_MSVC_STL_WRAP_RAISE'] or CONFIG['MOZ_MSVC_STL_WRAP_Throw']:
build_msvc_wrappers = 1
else:
build_msvc_wrappers = 0
if CONFIG['WRAP_STL_INCLUDES']:
DEFINES['_HAS_EXCEPTIONS'] = 0
if build_msvc_wrappers:
if CONFIG['MOZ_MSVC_STL_WRAP_RAISE']:
SOURCES += [
'../msvc_raise_wrappers.cpp',
'../msvc_throw_wrapper.cpp',
]
UNIFIED_SOURCES += [

View File

@ -10,8 +10,6 @@
#if defined(MOZ_MSVC_STL_WRAP_RAISE)
# include "msvc_raise_wrappers.h"
#elif defined(MOZ_MSVC_STL_WRAP_Throw)
# include "msvc_throw_wrapper.h"
#else
# error "Unknown STL wrapper tactic"
#endif