Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/src/lib/libexceptions_stub.js
4150 views
1
/**
2
* @license
3
* Copyright 2019 The Emscripten Authors
4
* SPDX-License-Identifier: MIT
5
*/
6
7
var LibraryExceptions = {};
8
9
[
10
'__cxa_throw',
11
'__cxa_rethrow',
12
'llvm_eh_typeid_for',
13
'__cxa_begin_catch',
14
'__cxa_end_catch',
15
'__cxa_get_exception_ptr',
16
'_ZSt18uncaught_exceptionv',
17
'__cxa_call_unexpected',
18
'__cxa_current_primary_exception',
19
'__cxa_rethrow_primary_exception',
20
'__cxa_find_matching_catch',
21
'__resumeException',
22
].forEach((name) => {
23
LibraryExceptions[name] = function() { abort(); };
24
#if !INCLUDE_FULL_LIBRARY
25
// This method of link-time error generation is not compatible with INCLUDE_FULL_LIBRARY
26
LibraryExceptions[name + '__deps'] = [function() {
27
error(`DISABLE_EXCEPTION_THROWING was set (likely due to -fno-exceptions), which means no C++ exception throwing support code is linked in, but such support is required by symbol '${name}'. Either do not set DISABLE_EXCEPTION_THROWING (if you do want exception throwing) or compile all source files with -fno-exceptions (so that no exceptions support code is required); also make sure DISABLE_EXCEPTION_CATCHING is set to the right value - if you want exceptions, it should be off, and vice versa.`);
28
}];
29
#endif
30
});
31
32
addToLibrary(LibraryExceptions);
33
34