Use COMReference to handle COM pointers in CreateShortcut
[LibreOffice.git] / bridges / source / cpp_uno / gcc3_linux_arm / share.hxx
blob040ce60b92518c382a8c3cc9b6921424a36ec8d7
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 #pragma once
20 #include <sal/config.h>
22 #include <typeinfo>
23 #include <exception>
24 #include <cstddef>
25 #include <unwind.h>
27 #include <cxxabi.h>
28 #ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h
29 #define _GLIBCXX_CDTOR_CALLABI
30 #endif
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 {
40 public:
41 explicit __class_type_info(char const * n): type_info(n) {}
42 ~__class_type_info() override;
45 #endif
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 {
52 public:
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;
60 #endif
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;
72 #endif
73 #endif
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;
83 int handlerCount;
84 #ifdef __ARM_EABI__
85 __cxa_exception *nextPropagatingException;
86 int propagationCount;
87 #else
88 int handlerSwitchValue;
89 const unsigned char *actionRecord;
90 const unsigned char *languageSpecificData;
91 void *catchTemp;
92 void *adjustedPtr;
93 #endif
94 _Unwind_Exception unwindHeader;
98 #endif
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();
110 #endif
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));
115 #endif
119 #if !HAVE_CXXABI_H_CXA_EH_GLOBALS
120 namespace __cxxabiv1 {
121 struct __cxa_eh_globals
123 __cxa_exception *caughtExceptions;
124 unsigned int uncaughtExceptions;
125 #ifdef __ARM_EABI__
126 __cxa_exception *propagatingExceptions;
127 #endif
130 #endif
132 #if !HAVE_CXXABI_H_CXA_GET_GLOBALS
133 namespace __cxxabiv1 {
134 extern "C" __cxa_eh_globals * __cxa_get_globals() throw();
136 #endif
138 #if !HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE
139 namespace __cxxabiv1 {
140 extern "C" std::type_info *__cxa_current_exception_type() throw();
142 #endif
144 namespace CPPU_CURRENT_NAMESPACE
146 void raiseException(
147 uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
148 void fillUnoException(uno_Any *, uno_Mapping * pCpp2Uno);
151 extern "C" void privateSnippetExecutor();
153 namespace arm
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: */