[Libreoffice-commits] core.git: bridges/source

Baptiste Daroussin bapt at FreeBSD.org
Wed Jun 11 01:19:41 PDT 2014


 bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx   |   32 +++++++++++++++++++
 bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx |    7 ++++
 2 files changed, 39 insertions(+)

New commits:
commit d2725abf5d8f1e33dfd061f899101afc970292fb
Author: Baptiste Daroussin <bapt at FreeBSD.org>
Date:   Tue Jun 10 18:35:36 2014 +0200

    Fix build on FreeBSD with libc++
    
    Change-Id: Ib51b05eb3f7c5d1288bee0f9f738ab1f37251c3e
    Reviewed-on: https://gerrit.libreoffice.org/9722
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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 e476119..624d543 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 b520054..f4c70a1 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--; )


More information about the Libreoffice-commits mailing list