summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorbrainbreaker <gautamprajapati06@gmail.com>2017-06-13 17:56:37 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-06-14 22:12:24 +0200
commite88584fed0d4f063ec80b9013f8a6e0cb97aa462 (patch)
tree822e4dc067dbf31e5fb6e15d975b699ae8366838 /bridges
parentbd8fa5664325dd0455b62774bd9033a09a23a3af (diff)
Clean up declaration of __cxa_get_globals in linux_arm bridge
This is the Linux/arm version of commit 5ba3d1740b03efa394b2d2bf34fb8a8d3db2331d, which did the same for the Linux/x86_64 bridge. Clang rejects the incompatible declarations of the same extern "C" function in different namespaces. This commit redeclares __cxa_get_globals so as to support clang for building Android in future. Change-Id: I4d733d3835d0dea5784701143f4ea1bc5d5ff363 Reviewed-on: https://gerrit.libreoffice.org/38735 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/share.hxx19
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx7
2 files changed, 21 insertions, 5 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
index 99cf7766a0c4..459db19ef4b3 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx
@@ -18,13 +18,21 @@
*/
#ifndef INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_ARM_SHARE_HXX
#define INCLUDED_BRIDGES_SOURCE_CPP_UNO_GCC3_LINUX_ARM_SHARE_HXX
-#include "uno/mapping.h"
+#include "sal/config.h"
#include <typeinfo>
#include <exception>
#include <cstddef>
#include <unwind.h>
+#include <cxxabi.h>
+#ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h
+#define _GLIBCXX_CDTOR_CALLABI
+#endif
+
+#include "config_cxxabi.h"
+#include "uno/mapping.h"
+
namespace CPPU_CURRENT_NAMESPACE
{
@@ -70,9 +78,16 @@ namespace CPPU_CURRENT_NAMESPACE
__cxa_exception *propagatingExceptions;
#endif
};
- extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
+}
+#if !HAVE_CXXABI_H_CXA_GET_GLOBALS
+namespace __cxxabiv1 {
+ extern "C" __cxa_eh_globals * __cxa_get_globals() throw();
+}
+#endif
+namespace CPPU_CURRENT_NAMESPACE
+{
void raiseException(
uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
void fillUnoException(
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
index 8942d1f948bd..ee8c17fc62a5 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
@@ -569,10 +569,11 @@ static void cpp_call(
}
catch (...)
{
-// __asm__ __volatile__ ("sub sp, sp, #2048\n");
-
// fill uno exception
- fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() );
+ fillUnoException(
+ reinterpret_cast< CPPU_CURRENT_NAMESPACE::__cxa_eh_globals * >(
+ __cxxabiv1::__cxa_get_globals())->caughtExceptions,
+ *ppUnoExc, pThis->getBridge()->getCpp2Uno());
// temporary params
for ( ; nTempIndices--; )