diff options
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx | 22 |
1 files changed, 20 insertions, 2 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 c305197e1655..f3f43e5719ea 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx @@ -17,12 +17,20 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "uno/mapping.h" +#include "sal/config.h" #include <typeinfo> #include <exception> #include <cstddef> +#include <cxxabi.h> +#ifndef _GLIBCXX_CDTOR_CALLABI // new in GCC 4.7 cxxabi.h +#define _GLIBCXX_CDTOR_CALLABI +#endif + +#include "config_gcc.h" +#include "uno/mapping.h" + namespace CPPU_CURRENT_NAMESPACE { @@ -65,7 +73,17 @@ struct __cxa_eh_globals } -extern "C" CPPU_CURRENT_NAMESPACE::__cxa_eh_globals *__cxa_get_globals () throw(); +// __cxa_get_globals is exported from libstdc++ since GCC 3.4.0 (CXXABI_1.3), +// but it is only declared in cxxabi.h (in namespace __cxxabiv1) since +// GCC 4.7.0. It returns a pointer to a struct __cxa_eh_globals, but that +// struct is only incompletely declared even in the GCC 4.7.0 cxxabi.h. +// Therefore, provide a declaration here for old GCC (libstdc++, really) version +// that returns a void pointer, and in the code calling it always cast to the +// above fake definition of CPPU_CURRENT_NAMESPACE::__cxa_eh_globals (which +// hopefully keeps matching the real definition in libstdc++): +#if !HAVE_GCC_CXXABI_H_CXA_GET_GLOBALS +namespace __cxxabiv1 { extern "C" void * __cxa_get_globals () throw(); } +#endif namespace CPPU_CURRENT_NAMESPACE { |