1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_MACOSX_X86_64_SHARE_HXX
20 #define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_MACOSX_X86_64_SHARE_HXX
22 #include <uno/mapping.h>
28 namespace CPPU_CURRENT_NAMESPACE
31 // From opensource.apple.com: libunwind-35.1/include/unwind.h
35 _URC_FOREIGN_EXCEPTION_CAUGHT
= 1,
36 _URC_FATAL_PHASE2_ERROR
= 2,
37 _URC_FATAL_PHASE1_ERROR
= 3,
39 _URC_END_OF_STACK
= 5,
40 _URC_HANDLER_FOUND
= 6,
41 _URC_INSTALL_CONTEXT
= 7,
42 _URC_CONTINUE_UNWIND
= 8
43 } _Unwind_Reason_Code
;
45 struct _Unwind_Exception
47 uint64_t exception_class
;
48 void (*exception_cleanup
)(_Unwind_Reason_Code reason
, struct _Unwind_Exception
* exc
);
49 uintptr_t private_1
; // non-zero means forced unwind
50 uintptr_t private_2
; // holds sp that phase1 found for phase2 to use
52 // The gcc implementation of _Unwind_Exception used attribute mode on the above fields
53 // which had the side effect of causing this whole struct to round up to 32 bytes in size.
54 // To be more explicit, we add pad fields added for binary compatibility.
60 // From libcppabi-24.2/include/unwind-cxx.h
62 typedef unsigned _Unwind_Ptr
__attribute__((__mode__(__pointer__
)));
64 // A C++ exception object consists of a header, which is a wrapper around
65 // an unwind object header with additional C++ specific information,
66 // followed by the exception object itself.
68 struct __cxa_exception
71 // This is a new field to support C++ 0x exception_ptr.
72 // For binary compatibility it is at the start of this
73 // struct which is prepended to the object thrown in
74 // __cxa_allocate_exception.
75 size_t referenceCount
;
77 // Manage the exception object itself.
78 std::type_info
*exceptionType
;
79 void (*exceptionDestructor
)(void *);
81 // The C++ standard has entertaining rules wrt calling set_terminate
82 // and set_unexpected in the middle of the exception cleanup process.
83 void (*unexpectedHandler
)(); // std::unexpected_handler dropped from C++17
84 std::terminate_handler terminateHandler
;
86 // The caught exception stack threads through here.
87 __cxa_exception
*nextException
;
89 // How many nested handlers have caught this exception. A negated
90 // value is a signal that this object has been rethrown.
93 #ifdef __ARM_EABI_UNWINDER__
94 // Stack of exceptions in cleanups.
95 __cxa_exception
* nextPropagatingException
;
97 // The number of active cleanup handlers for this exception.
100 // Cache parsed handler data from the personality routine Phase 1
101 // for Phase 2 and __cxa_call_unexpected.
102 int handlerSwitchValue
;
103 const unsigned char *actionRecord
;
104 const unsigned char *languageSpecificData
;
105 _Unwind_Ptr catchTemp
;
109 // This is a new field to support C++ 0x exception_ptr.
110 // For binary compatibility it is placed where the compiler
111 // previously adding padded to 64-bit align unwindHeader.
112 size_t referenceCount
;
115 // The generic exception header. Must be last.
116 _Unwind_Exception unwindHeader
;
119 // Each thread in a C++ program has access to a __cxa_eh_globals object.
120 struct __cxa_eh_globals
122 __cxa_exception
*caughtExceptions
;
123 unsigned int uncaughtExceptions
;
124 #ifdef __ARM_EABI_UNWINDER__
125 __cxa_exception
* propagatingExceptions
;
131 extern "C" CPPU_CURRENT_NAMESPACE::__cxa_eh_globals
*__cxa_get_globals () throw();
133 namespace CPPU_CURRENT_NAMESPACE
137 uno_Any
* pUnoExc
, uno_Mapping
* pUno2Cpp
);
139 void fillUnoException(uno_Any
*, uno_Mapping
* pCpp2Uno
);
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */