Debian Codegraph @

js/src/builtin/temporal/Crash.h

raw
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: set ts=8 sts=2 et sw=2 tw=80:
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 #ifndef builtin_temporal_Crash_h
8 #define builtin_temporal_Crash_h
9
10 #include "mozilla/Assertions.h"
11 #include "mozilla/Compiler.h"
12
13 #include <cstdlib>
14
15 // Old GCC don't support calling MOZ_CRASH in a constexpr function. Directly
16 // abort in this case without calling the crash annotation functions.
17
18 #if MOZ_IS_GCC
19 # if !MOZ_GCC_VERSION_AT_LEAST(9, 1, 0)
20 # define JS_CONSTEXPR_CRASH(...) std::abort()
21 # else
22 # define JS_CONSTEXPR_CRASH(...) MOZ_CRASH(__VA_ARGS__)
23 # endif
24 #else
25 # define JS_CONSTEXPR_CRASH(...) MOZ_CRASH(__VA_ARGS__)
26 #endif
27
28 #endif