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 .
20 #include <sal/config.h>
28 #ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h
29 #define _GLIBCXX_CDTOR_CALLABI
32 #include <config_cxxabi.h>
33 #include <uno/mapping.h>
35 #if !HAVE_CXXABI_H_CLASS_TYPE_INFO
36 // <https://mentorembedded.github.io/cxx-abi/abi.html>,
37 // libstdc++-v3/libsupc++/cxxabi.h:
38 namespace __cxxabiv1
{
39 class __class_type_info
: public std::type_info
{
41 explicit __class_type_info(char const * n
): type_info(n
) {}
42 ~__class_type_info() override
;
47 #if !HAVE_CXXABI_H_SI_CLASS_TYPE_INFO
48 // <https://mentorembedded.github.io/cxx-abi/abi.html>,
49 // libstdc++-v3/libsupc++/cxxabi.h:
50 namespace __cxxabiv1
{
51 class __si_class_type_info
: public __class_type_info
{
53 __class_type_info
const * __base_type
;
54 explicit __si_class_type_info(
55 char const * n
, __class_type_info
const *base
):
56 __class_type_info(n
), __base_type(base
) {}
57 ~__si_class_type_info() override
;
62 #if !HAVE_CXXABI_H_CXA_EXCEPTION
63 namespace __cxxabiv1
{
64 struct __cxa_exception
66 #if defined _LIBCPPABI_VERSION // detect libc++abi
67 #if defined __LP64__ || defined __ARM_EABI__
68 // Quoting android-ndk-r18b/sources/cxx-stl/llvm-libc++abi/src/cxa_exception.hpp: "This is a
69 // new field to support C++ 0x exception_ptr. For binary compatibility it is at the start of
70 // this struct which is prepended to the object thrown in __cxa_allocate_exception."
71 std::size_t referenceCount
;
75 std::type_info
*exceptionType
;
76 void (*exceptionDestructor
)(void *);
78 void (*unexpectedHandler
)(); // std::unexpected_handler dropped from C++17
79 std::terminate_handler terminateHandler
;
81 __cxa_exception
*nextException
;
85 __cxa_exception
*nextPropagatingException
;
88 int handlerSwitchValue
;
89 const unsigned char *actionRecord
;
90 const unsigned char *languageSpecificData
;
94 _Unwind_Exception unwindHeader
;
100 namespace CPPU_CURRENT_NAMESPACE
103 void dummy_can_throw_anything( char const * );
105 // -- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
107 #if !HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION
108 extern "C" void *__cxa_allocate_exception(
109 std::size_t thrown_size
) throw();
111 #if !HAVE_CXXABI_H_CXA_THROW
112 extern "C" void __cxa_throw (
113 void *thrown_exception
, std::type_info
*tinfo
,
114 void (*dest
) (void *) ) __attribute__((noreturn
));
119 #if !HAVE_CXXABI_H_CXA_EH_GLOBALS
120 namespace __cxxabiv1
{
121 struct __cxa_eh_globals
123 __cxa_exception
*caughtExceptions
;
124 unsigned int uncaughtExceptions
;
126 __cxa_exception
*propagatingExceptions
;
132 #if !HAVE_CXXABI_H_CXA_GET_GLOBALS
133 namespace __cxxabiv1
{
134 extern "C" __cxa_eh_globals
* __cxa_get_globals() throw();
138 #if !HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE
139 namespace __cxxabiv1
{
140 extern "C" std::type_info
*__cxa_current_exception_type() throw();
144 namespace CPPU_CURRENT_NAMESPACE
147 uno_Any
* pUnoExc
, uno_Mapping
* pUno2Cpp
);
148 void fillUnoException(uno_Any
*, uno_Mapping
* pCpp2Uno
);
151 extern "C" void privateSnippetExecutor();
155 enum armlimits
{ MAX_GPR_REGS
= 4, MAX_FPR_REGS
= 8 };
156 bool return_in_hidden_param( typelib_TypeDescriptionReference
*pTypeRef
);
159 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */