memory/mozalloc/msvc_raise_wrappers.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial