diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2014-06-10 18:35:36 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-06-11 08:19:19 +0000 |
commit | d2725abf5d8f1e33dfd061f899101afc970292fb (patch) | |
tree | eab757273a6ed503fcafe0da830dc09c226e1adc /bridges/source | |
parent | 21a1ff063475fe8f26686591caed546e32ad42d5 (diff) |
Fix build on FreeBSD with libc++
Change-Id: Ib51b05eb3f7c5d1288bee0f9f738ab1f37251c3e
Reviewed-on: https://gerrit.libreoffice.org/9722
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'bridges/source')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx | 32 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx | 7 |
2 files changed, 39 insertions, 0 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx index e4761196a647..624d543fa0e1 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx @@ -31,6 +31,32 @@ #include "config_gcc.h" #include "uno/mapping.h" +#ifdef _LIBCPP_VERSION + +namespace __cxxabiv1 +{ + struct __class_type_info : public std::type_info + { + explicit __class_type_info( const char *__n ) : type_info( __n ) { } + virtual ~__class_type_info(); + }; + + struct __si_class_type_info : public __class_type_info + { + explicit __si_class_type_info( const char *__n, const __class_type_info *__b ) : + __class_type_info( __n ), __base_type( __b ) { } + virtual ~__si_class_type_info(); + const __class_type_info *__base_type; + }; + +extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) _NOEXCEPT; + +extern "C" _LIBCPP_NORETURN void __cxa_throw( + void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ); +} + +#else + namespace CPPU_CURRENT_NAMESPACE { @@ -101,6 +127,8 @@ extern "C" void __cxa_throw( __attribute__((noreturn)); } #endif +} +#endif namespace CPPU_CURRENT_NAMESPACE { @@ -109,7 +137,11 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ); void fillUnoException( +#ifdef _LIBCPP_VERSION + __cxxabiv1::__cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); +#else __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno ); +#endif } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx index b5200544b764..f4c70a1a6e92 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx @@ -285,10 +285,17 @@ static void cpp_call( catch (...) { // fill uno exception +#ifdef _LIBCPP_VERSION + CPPU_CURRENT_NAMESPACE::fillUnoException( + reinterpret_cast< __cxxabiv1::__cxa_eh_globals * >( + __cxxabiv1::__cxa_get_globals())->caughtExceptions, + *ppUnoExc, pThis->getBridge()->getCpp2Uno()); +#else fillUnoException( reinterpret_cast< CPPU_CURRENT_NAMESPACE::__cxa_eh_globals * >( __cxxabiv1::__cxa_get_globals())->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno()); +#endif // temporary params for ( ; nTempIndices--; ) |