diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-03-27 18:51:25 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-03-27 18:52:49 +0200 |
commit | 54e3855bffafe24d2dbb29451885282bab57ecef (patch) | |
tree | 33f8258d30013a8f0ddf4dd37539a1d4823a15c4 /bridges | |
parent | fix build, restore these constructors for now (diff) | |
download | core-54e3855bffafe24d2dbb29451885282bab57ecef.tar.gz core-54e3855bffafe24d2dbb29451885282bab57ecef.zip |
MinGW: Adapted cpp_uno bridge to GCC 4.7
...which incompatibly changed the calling convention of the third (dest)
function pointer parameter of __cxa_throw to __thiscall.
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/mingw_intel/except.cxx | 9 | ||||
-rw-r--r-- | bridges/source/cpp_uno/mingw_intel/share.hxx | 19 | ||||
-rw-r--r-- | bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx | 2 |
3 files changed, 23 insertions, 7 deletions
diff --git a/bridges/source/cpp_uno/mingw_intel/except.cxx b/bridges/source/cpp_uno/mingw_intel/except.cxx index 4b745885152f..308ccb842e74 100644 --- a/bridges/source/cpp_uno/mingw_intel/except.cxx +++ b/bridges/source/cpp_uno/mingw_intel/except.cxx @@ -29,7 +29,12 @@ #include <stdio.h> #include <string.h> + #include <cxxabi.h> +#ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h +#define _GLIBCXX_CDTOR_CALLABI +#endif + #include <boost/unordered_map.hpp> #include <rtl/instance.hxx> @@ -193,7 +198,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR struct RTTISingleton: public rtl::Static< RTTI, RTTISingleton > {}; //-------------------------------------------------------------------------------------------------- -static void deleteException( void * pExc ) +extern "C" { +static void _GLIBCXX_CDTOR_CALLABI deleteException( void * pExc ) { __cxa_exception const * header = ((__cxa_exception const *)pExc - 1); typelib_TypeDescription * pTD = 0; @@ -206,6 +212,7 @@ static void deleteException( void * pExc ) ::typelib_typedescription_release( pTD ); } } +} //================================================================================================== void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) diff --git a/bridges/source/cpp_uno/mingw_intel/share.hxx b/bridges/source/cpp_uno/mingw_intel/share.hxx index da2367ad172b..e6e4337f32c0 100644 --- a/bridges/source/cpp_uno/mingw_intel/share.hxx +++ b/bridges/source/cpp_uno/mingw_intel/share.hxx @@ -68,17 +68,26 @@ struct __cxa_exception _Unwind_Exception unwindHeader; }; +struct __cxa_eh_globals +{ + __cxa_exception *caughtExceptions; + unsigned int uncaughtExceptions; +}; + +} + +extern "C" CPPU_CURRENT_NAMESPACE::__cxa_eh_globals *__cxa_get_globals () throw(); + +// The following are in cxxabi.h since GCC 4.7: +#if __GNUC__ == 4 && __GNUC_MINOR__ <= 6 extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); extern "C" void __cxa_throw ( void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); +#endif -struct __cxa_eh_globals +namespace CPPU_CURRENT_NAMESPACE { - __cxa_exception *caughtExceptions; - unsigned int uncaughtExceptions; -}; -extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); // ----- diff --git a/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx b/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx index fd36c7533f5b..d2ae05721b3d 100644 --- a/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx @@ -345,7 +345,7 @@ static void cpp_call( catch (...) { // fill uno exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); + fillUnoException( __cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); // temporary params for ( ; nTempIndizes--; ) |