2 * Copyright (c) 2013 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
8 * This file defines _Unwind_RaiseException() etc. using the SJLJ
9 * (setjmp()/longjmp()-based) versions provided by PNaCl's libstdc++.
11 * This allows a single build of libstdc++ to support both the SJLJ
12 * and non-SJLJ models of C++ exception handling. The SJLJ version is
13 * enabled by linking in this redirection file.
21 struct _Unwind_Exception;
23 int __pnacl_eh_sjlj_Unwind_RaiseException(struct _Unwind_Exception *exc);
24 int __pnacl_eh_sjlj_Unwind_Resume_or_Rethrow(struct _Unwind_Exception *exc);
25 void __pnacl_eh_sjlj_Unwind_DeleteException(struct _Unwind_Exception *exc);
26 void __pnacl_eh_sjlj_cxa_call_unexpected(struct _Unwind_Exception *exc);
29 int _Unwind_RaiseException(struct _Unwind_Exception *exc) {
30 return __pnacl_eh_sjlj_Unwind_RaiseException(exc);
33 int _Unwind_Resume_or_Rethrow(struct _Unwind_Exception *exc) {
34 return __pnacl_eh_sjlj_Unwind_Resume_or_Rethrow(exc);
37 void _Unwind_DeleteException(struct _Unwind_Exception *exc) {
38 __pnacl_eh_sjlj_Unwind_DeleteException(exc);
41 void __cxa_call_unexpected(struct _Unwind_Exception *exc) {
42 __pnacl_eh_sjlj_cxa_call_unexpected(exc);
46 * This is a dummy version of the C++ personality function to prevent
47 * libstdc++'s eh_personality.cc from being linked in, since that file
48 * also defines __cxa_call_unexpected(), which would clash with our
51 * The only references to this personality function will be from LLVM
52 * "landingpad" instructions, which will be removed by the PNaClSjLjEH
55 void __gxx_personality_v0() {