Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/system/lib/wasmfs/support.h
6174 views
1
// Copyright 2022 The Emscripten Authors. All rights reserved.
2
// Emscripten is available under two separate licenses, the MIT license and the
3
// University of Illinois/NCSA Open Source License. Both these licenses can be
4
// found in the LICENSE file.
5
6
#pragma once
7
8
#include <cstdlib>
9
10
#ifndef NDEBUG
11
// In debug builds show a message.
12
namespace wasmfs {
13
[[noreturn]] void
14
handle_unreachable(const char* msg, const char* file, unsigned line);
15
}
16
#define WASMFS_UNREACHABLE(msg) \
17
wasmfs::handle_unreachable(msg, __FILE__, __LINE__)
18
#else
19
// In release builds trap in a compact manner.
20
#define WASMFS_UNREACHABLE(msg) __builtin_trap()
21
#endif
22
23