Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * vim: sw=4 ts=4 et : |
michael@0 | 3 | */ |
michael@0 | 4 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef mozilla_msvc_raise_wrappers_h |
michael@0 | 9 | #define mozilla_msvc_raise_wrappers_h |
michael@0 | 10 | |
michael@0 | 11 | #ifdef _XSTDDEF_ |
michael@0 | 12 | # error "Unable to wrap _RAISE(); CRT _RAISE() already defined" |
michael@0 | 13 | #endif |
michael@0 | 14 | #ifdef _XUTILITY_ |
michael@0 | 15 | # error "Unabled to wrap _X[exception]"(); CRT versions already declared" |
michael@0 | 16 | #endif |
michael@0 | 17 | |
michael@0 | 18 | #include "mozilla/mozalloc_abort.h" |
michael@0 | 19 | |
michael@0 | 20 | namespace std { |
michael@0 | 21 | |
michael@0 | 22 | // NB: user code is not supposed to touch the std:: namespace. We're |
michael@0 | 23 | // doing this after careful review because we want to define our own |
michael@0 | 24 | // exception throwing semantics. Don't try this at home! |
michael@0 | 25 | |
michael@0 | 26 | MOZALLOC_EXPORT __declspec(noreturn) void moz_Xinvalid_argument(const char*); |
michael@0 | 27 | MOZALLOC_EXPORT __declspec(noreturn) void moz_Xlength_error(const char*); |
michael@0 | 28 | MOZALLOC_EXPORT __declspec(noreturn) void moz_Xout_of_range(const char*); |
michael@0 | 29 | MOZALLOC_EXPORT __declspec(noreturn) void moz_Xoverflow_error(const char*); |
michael@0 | 30 | MOZALLOC_EXPORT __declspec(noreturn) void moz_Xruntime_error(const char*); |
michael@0 | 31 | |
michael@0 | 32 | } // namespace std |
michael@0 | 33 | |
michael@0 | 34 | #ifndef MOZALLOC_DONT_WRAP_RAISE_FUNCTIONS |
michael@0 | 35 | |
michael@0 | 36 | # define _Xinvalid_argument moz_Xinvalid_argument |
michael@0 | 37 | # define _Xlength_error moz_Xlength_error |
michael@0 | 38 | # define _Xout_of_range moz_Xout_of_range |
michael@0 | 39 | # define _Xoverflow_error moz_Xoverflow_error |
michael@0 | 40 | # define _Xruntime_error moz_Xruntime_error |
michael@0 | 41 | |
michael@0 | 42 | # include <xstddef> |
michael@0 | 43 | # include <xutility> |
michael@0 | 44 | |
michael@0 | 45 | # undef _RAISE |
michael@0 | 46 | # define _RAISE(x) mozalloc_abort((x).what()) |
michael@0 | 47 | |
michael@0 | 48 | #endif // ifndef MOZALLOC_DONT_WRAP_RAISE_FUNCTIONS |
michael@0 | 49 | |
michael@0 | 50 | #endif // ifndef mozilla_msvc_raise_wrappers_h |