LibreOffice Module bridges (master) 1
gcc3_linux_intel/share.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <sal/config.h>
21
22#include <typeinfo>
23#include <exception>
24#include <cstddef>
25
26#include <cxxabi.h>
27#ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h
28#define _GLIBCXX_CDTOR_CALLABI
29#endif
30#include <unwind.h>
31
32#include <config_cxxabi.h>
33#include <uno/any2.h>
34#include <uno/mapping.h>
35
36#if !HAVE_CXXABI_H_CLASS_TYPE_INFO
37// <https://mentorembedded.github.io/cxx-abi/abi.html>,
38// libstdc++-v3/libsupc++/cxxabi.h:
39namespace __cxxabiv1 {
40class __class_type_info: public std::type_info {
41public:
42 explicit __class_type_info(char const * n): type_info(n) {}
44};
45}
46#endif
47
48#if !HAVE_CXXABI_H_SI_CLASS_TYPE_INFO
49// <https://mentorembedded.github.io/cxx-abi/abi.html>,
50// libstdc++-v3/libsupc++/cxxabi.h:
51namespace __cxxabiv1 {
52class __si_class_type_info: public __class_type_info {
53public:
56 char const * n, __class_type_info const *base):
59};
60}
61#endif
62
64{
65
66void dummy_can_throw_anything( char const * );
67
68// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h
69
70struct __cxa_exception
71{
72 std::type_info *exceptionType;
73 void (*exceptionDestructor)(void *);
74
75 void (*unexpectedHandler)(); // std::unexpected_handler dropped from C++17
76 std::terminate_handler terminateHandler;
77
78 __cxa_exception *nextException;
79
80 int handlerCount;
81
83 const unsigned char *actionRecord;
84 const unsigned char *languageSpecificData;
85 void *catchTemp;
86 void *adjustedPtr;
87
88 _Unwind_Exception unwindHeader;
89};
90
91struct __cxa_eh_globals
92{
93 __cxa_exception *caughtExceptions;
94 unsigned int uncaughtExceptions;
95};
96
97}
98
99// __cxa_get_globals is exported from libstdc++ since GCC 3.4.0 (CXXABI_1.3),
100// but it is only declared in cxxabi.h (in namespace __cxxabiv1) since
101// GCC 4.7.0. It returns a pointer to a struct __cxa_eh_globals, but that
102// struct is only incompletely declared even in the GCC 4.7.0 cxxabi.h.
103// Therefore, provide a declaration here for old GCC (libstdc++, really) version
104// that returns a void pointer, and in the code calling it always cast to the
105// above fake definition of CPPU_CURRENT_NAMESPACE::__cxa_eh_globals (which
106// hopefully keeps matching the real definition in libstdc++); similarly for
107// __cxa_allocate_exception and __cxa_throw, though they do not have the
108// additional problem of an incompletely declared return type:
109
110#if !HAVE_CXXABI_H_CXA_GET_GLOBALS
111namespace __cxxabiv1 { extern "C" void * __cxa_get_globals() throw(); }
112#endif
113
114#if !HAVE_CXXABI_H_CXA_CURRENT_EXCEPTION_TYPE
115namespace __cxxabiv1 {
116extern "C" std::type_info *__cxa_current_exception_type() throw();
117}
118#endif
119
120#if !HAVE_CXXABI_H_CXA_ALLOCATE_EXCEPTION
121namespace __cxxabiv1 {
122extern "C" void * __cxa_allocate_exception(std::size_t thrown_size) throw();
123}
124#endif
125
126#if !HAVE_CXXABI_H_CXA_THROW
127namespace __cxxabiv1 {
128extern "C" void __cxa_throw(
129 void * thrown_exception, void * tinfo, void (* dest)(void *))
130 __attribute__((noreturn));
131}
132#endif
133
140
142{
143
144void raiseException(
145 uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
146
147void fillUnoException(uno_Any *, uno_Mapping * pCpp2Uno);
148
149}
150
151namespace x86
152{
153 bool isSimpleReturnType(typelib_TypeDescription * pTD, bool recursive = false);
154}
155
156/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
__class_type_info(const char *__n)
Definition: rtti.h:217
const __class_type_info * __base_type
Definition: rtti.h:309
__si_class_type_info(char const *n, __class_type_info const *base)
void const * base
void privateSnippetExecutorDouble()
void privateSnippetExecutorClass()
void privateSnippetExecutorFloat()
void privateSnippetExecutorVoid()
void privateSnippetExecutorHyper()
void privateSnippetExecutorGeneral()
sal_Int64 n
struct _uno_Mapping uno_Mapping
Definition: msvc/except.hxx:33
struct _typelib_TypeDescription typelib_TypeDescription
Definition: msvc/except.hxx:53
struct _uno_Any uno_Any
Definition: msvc/except.hxx:32
void dummy_can_throw_anything(char const *)
void fillUnoException(uno_Any *pUnoExc, uno_Mapping *pCpp2Uno)
void __cxa_throw(void *thrown_exception, std::type_info *tinfo, void(*dest)(void *)) __attribute__((noreturn))
__cxa_eh_globals * __cxa_get_globals()
void * __cxa_allocate_exception(size_t thrown_size)
std::type_info * __cxa_current_exception_type()
bool isSimpleReturnType(typelib_TypeDescription *pTD, bool recursive=false)
unsigned _Unwind_Word __attribute__((__mode__(__word__)))
Definition: unwind-cxx.h:45