1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _ARM_SHARE_HXX
28 #define _ARM_SHARE_HXX
29 #include "uno/mapping.h"
30 
31 #include <typeinfo>
32 #include <exception>
33 #include <cstddef>
34 #include <unwind.h>
35 
36 namespace CPPU_CURRENT_NAMESPACE
37 {
38 
39     void dummy_can_throw_anything( char const * );
40 
41     // -- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
42 
43     struct __cxa_exception
44     {
45         ::std::type_info *exceptionType;
46         void (*exceptionDestructor)(void *);
47 
48         ::std::unexpected_handler unexpectedHandler;
49         ::std::terminate_handler terminateHandler;
50 
51         __cxa_exception *nextException;
52 
53         int handlerCount;
54 #ifdef __ARM_EABI__
55 	__cxa_exception *nextPropagatingException;
56 	int propagationCount;
57 #else
58         int handlerSwitchValue;
59         const unsigned char *actionRecord;
60         const unsigned char *languageSpecificData;
61         void *catchTemp;
62         void *adjustedPtr;
63 #endif
64         _Unwind_Exception unwindHeader;
65     };
66 
67     extern "C" void *__cxa_allocate_exception(
68         std::size_t thrown_size ) throw();
69     extern "C" void __cxa_throw (
70         void *thrown_exception, std::type_info *tinfo,
71         void (*dest) (void *) ) __attribute__((noreturn));
72 
73     struct __cxa_eh_globals
74     {
75         __cxa_exception *caughtExceptions;
76         unsigned int uncaughtExceptions;
77 #ifdef __ARM_EABI__
78 	__cxa_exception *propagatingExceptions;
79 #endif
80     };
81     extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
82 
83     // -----
84 
85     //====================================================================
86     void raiseException(
87         uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
88     //====================================================================
89     void fillUnoException(
90         __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
91 }
92 
93 namespace arm
94 {
95     enum armlimits { MAX_GPR_REGS = 4 };
96     bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef );
97 }
98 
99 #endif
100 /* vi:set tabstop=4 shiftwidth=4 expandtab: */
101