From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- memory/mozalloc/msvc_raise_wrappers.h | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 memory/mozalloc/msvc_raise_wrappers.h (limited to 'memory/mozalloc/msvc_raise_wrappers.h') diff --git a/memory/mozalloc/msvc_raise_wrappers.h b/memory/mozalloc/msvc_raise_wrappers.h new file mode 100644 index 000000000..91b77f453 --- /dev/null +++ b/memory/mozalloc/msvc_raise_wrappers.h @@ -0,0 +1,41 @@ +/* -*- 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_raise_wrappers_h +#define mozilla_msvc_raise_wrappers_h + +#ifdef _XSTDDEF_ +# error "Unable to wrap _RAISE(); CRT _RAISE() already defined" +#endif +#ifdef _XUTILITY_ +# error "Unable to wrap _X[exception](); CRT versions already declared" +#endif +#ifdef _FUNCTIONAL_ +# error "Unable to wrap _Xbad_function_call(); CRT version already declared" +#endif + +#include "mozilla/mozalloc_abort.h" + +// xutility will declare the following functions in the std namespace. +// We #define them to be named differently so we can ensure the exception +// throwing semantics of these functions work exactly the way we want, by +// defining our own versions in msvc_raise_wrappers.cpp. +# define _Xinvalid_argument moz_Xinvalid_argument +# define _Xlength_error moz_Xlength_error +# define _Xout_of_range moz_Xout_of_range +# define _Xoverflow_error moz_Xoverflow_error +# define _Xruntime_error moz_Xruntime_error +// used by +# define _Xbad_function_call moz_Xbad_function_call + +# include +# include + +# undef _RAISE +# define _RAISE(x) mozalloc_abort((x).what()) + +#endif // ifndef mozilla_msvc_raise_wrappers_h -- cgit v1.2.3