174f1be36SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
374f1be36SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
474f1be36SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
574f1be36SAndrew Rist  * distributed with this work for additional information
674f1be36SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
774f1be36SAndrew Rist  * to you under the Apache License, Version 2.0 (the
874f1be36SAndrew Rist  * "License"); you may not use this file except in compliance
974f1be36SAndrew Rist  * with the License.  You may obtain a copy of the License at
1074f1be36SAndrew Rist  *
1174f1be36SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1274f1be36SAndrew Rist  *
1374f1be36SAndrew Rist  * Unless required by applicable law or agreed to in writing,
1474f1be36SAndrew Rist  * software distributed under the License is distributed on an
1574f1be36SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1674f1be36SAndrew Rist  * KIND, either express or implied.  See the License for the
1774f1be36SAndrew Rist  * specific language governing permissions and limitations
1874f1be36SAndrew Rist  * under the License.
1974f1be36SAndrew Rist  *
2074f1be36SAndrew Rist  *************************************************************/
2174f1be36SAndrew Rist 
2274f1be36SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "uno/mapping.h"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir namespace CPPU_CURRENT_NAMESPACE
27cdf0e10cSrcweir {
28cdf0e10cSrcweir 
29cdf0e10cSrcweir void dummy_can_throw_anything( char const * );
30cdf0e10cSrcweir 
31cdf0e10cSrcweir // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
32cdf0e10cSrcweir 
33*bcc22a4cSDamjan Jovanovic #ifdef __GLIBCXX__
34cdf0e10cSrcweir struct _Unwind_Exception
35cdf0e10cSrcweir {
36cdf0e10cSrcweir     unsigned exception_class __attribute__((__mode__(__DI__)));
37cdf0e10cSrcweir     void * exception_cleanup;
38cdf0e10cSrcweir     unsigned private_1 __attribute__((__mode__(__word__)));
39cdf0e10cSrcweir     unsigned private_2 __attribute__((__mode__(__word__)));
40cdf0e10cSrcweir } __attribute__((__aligned__));
41cdf0e10cSrcweir 
42cdf0e10cSrcweir struct __cxa_exception
43cdf0e10cSrcweir {
44cdf0e10cSrcweir     ::std::type_info *exceptionType;
45cdf0e10cSrcweir     void (*exceptionDestructor)(void *);
46cdf0e10cSrcweir 
47cdf0e10cSrcweir     ::std::unexpected_handler unexpectedHandler;
48cdf0e10cSrcweir     ::std::terminate_handler terminateHandler;
49cdf0e10cSrcweir 
50cdf0e10cSrcweir     __cxa_exception *nextException;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir     int handlerCount;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir     int handlerSwitchValue;
55cdf0e10cSrcweir     const unsigned char *actionRecord;
56cdf0e10cSrcweir     const unsigned char *languageSpecificData;
57cdf0e10cSrcweir     void *catchTemp;
58cdf0e10cSrcweir     void *adjustedPtr;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     _Unwind_Exception unwindHeader;
61cdf0e10cSrcweir };
62*bcc22a4cSDamjan Jovanovic #endif /* __GLIBCXX__ */
63cdf0e10cSrcweir 
64cdf0e10cSrcweir extern "C" void *__cxa_allocate_exception(
65cdf0e10cSrcweir     std::size_t thrown_size ) throw();
66cdf0e10cSrcweir extern "C" void __cxa_throw (
67cdf0e10cSrcweir     void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn));
68cdf0e10cSrcweir 
69*bcc22a4cSDamjan Jovanovic #ifdef __GLIBCXX__
70cdf0e10cSrcweir struct __cxa_eh_globals
71cdf0e10cSrcweir {
72cdf0e10cSrcweir     __cxa_exception *caughtExceptions;
73cdf0e10cSrcweir     unsigned int uncaughtExceptions;
74cdf0e10cSrcweir };
75*bcc22a4cSDamjan Jovanovic __cxa_eh_globals *__INTERNAL__cxa_get_globals () throw();
76*bcc22a4cSDamjan Jovanovic #endif /* __GLIBCXX__ */
77cdf0e10cSrcweir 
78cdf0e10cSrcweir // -----
79cdf0e10cSrcweir 
80cdf0e10cSrcweir //==================================================================================================
81cdf0e10cSrcweir void raiseException(
82cdf0e10cSrcweir     uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
83cdf0e10cSrcweir //==================================================================================================
84*bcc22a4cSDamjan Jovanovic #ifndef __GLIBCXX__
85*bcc22a4cSDamjan Jovanovic using __cxxabiv1:: __cxa_exception;
86*bcc22a4cSDamjan Jovanovic #endif /* __GLIBCXX__ */
87*bcc22a4cSDamjan Jovanovic 
88cdf0e10cSrcweir void fillUnoException(
89cdf0e10cSrcweir     __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
90cdf0e10cSrcweir }
91