1*74f1be36SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*74f1be36SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*74f1be36SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*74f1be36SAndrew Rist * distributed with this work for additional information 6*74f1be36SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*74f1be36SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*74f1be36SAndrew Rist * "License"); you may not use this file except in compliance 9*74f1be36SAndrew Rist * with the License. You may obtain a copy of the License at 10*74f1be36SAndrew Rist * 11*74f1be36SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*74f1be36SAndrew Rist * 13*74f1be36SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*74f1be36SAndrew Rist * software distributed under the License is distributed on an 15*74f1be36SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*74f1be36SAndrew Rist * KIND, either express or implied. See the License for the 17*74f1be36SAndrew Rist * specific language governing permissions and limitations 18*74f1be36SAndrew Rist * under the License. 19*74f1be36SAndrew Rist * 20*74f1be36SAndrew Rist *************************************************************/ 21*74f1be36SAndrew Rist 22*74f1be36SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #include <typeinfo> 25cdf0e10cSrcweir #include <exception> 26cdf0e10cSrcweir #include <cstddef> 27cdf0e10cSrcweir 28cdf0e10cSrcweir namespace CPPU_CURRENT_NAMESPACE 29cdf0e10cSrcweir { 30cdf0e10cSrcweir 31cdf0e10cSrcweir // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h 32cdf0e10cSrcweir 33cdf0e10cSrcweir struct _Unwind_Exception 34cdf0e10cSrcweir { 35cdf0e10cSrcweir unsigned exception_class __attribute__((__mode__(__DI__))); 36cdf0e10cSrcweir void * exception_cleanup; 37cdf0e10cSrcweir unsigned private_1 __attribute__((__mode__(__word__))); 38cdf0e10cSrcweir unsigned private_2 __attribute__((__mode__(__word__))); 39cdf0e10cSrcweir } __attribute__((__aligned__)); 40cdf0e10cSrcweir 41cdf0e10cSrcweir struct __cxa_exception 42cdf0e10cSrcweir { 43cdf0e10cSrcweir ::std::type_info *exceptionType; 44cdf0e10cSrcweir void (*exceptionDestructor)(void *); 45cdf0e10cSrcweir 46cdf0e10cSrcweir ::std::unexpected_handler unexpectedHandler; 47cdf0e10cSrcweir ::std::terminate_handler terminateHandler; 48cdf0e10cSrcweir 49cdf0e10cSrcweir __cxa_exception *nextException; 50cdf0e10cSrcweir 51cdf0e10cSrcweir int handlerCount; 52cdf0e10cSrcweir 53cdf0e10cSrcweir int handlerSwitchValue; 54cdf0e10cSrcweir const unsigned char *actionRecord; 55cdf0e10cSrcweir const unsigned char *languageSpecificData; 56cdf0e10cSrcweir void *catchTemp; 57cdf0e10cSrcweir void *adjustedPtr; 58cdf0e10cSrcweir 59cdf0e10cSrcweir _Unwind_Exception unwindHeader; 60cdf0e10cSrcweir }; 61cdf0e10cSrcweir 62cdf0e10cSrcweir extern "C" void *__cxa_allocate_exception( 63cdf0e10cSrcweir std::size_t thrown_size ) throw(); 64cdf0e10cSrcweir extern "C" void __cxa_throw ( 65cdf0e10cSrcweir void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); 66cdf0e10cSrcweir 67cdf0e10cSrcweir struct __cxa_eh_globals 68cdf0e10cSrcweir { 69cdf0e10cSrcweir __cxa_exception *caughtExceptions; 70cdf0e10cSrcweir unsigned int uncaughtExceptions; 71cdf0e10cSrcweir }; 72cdf0e10cSrcweir extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); 73cdf0e10cSrcweir 74cdf0e10cSrcweir // ----- 75cdf0e10cSrcweir 76cdf0e10cSrcweir //================================================================================================== 77cdf0e10cSrcweir void raiseException( 78cdf0e10cSrcweir uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ); 79cdf0e10cSrcweir //================================================================================================== 80cdf0e10cSrcweir void fillUnoException( 81cdf0e10cSrcweir __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); 82cdf0e10cSrcweir } 83