summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2009-12-09 22:07:29 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2009-12-09 22:07:29 +0100
commit86edbec83e25d66f187f5c3e7a4a44dae0257e47 (patch)
treeddb4f9e30f050d967784b0ae8ad4b1b8bd0eff26
parenteb927863522b0ba8a67a245e6f0d631406bf7e1a (diff)
parentd89afea42e33bb771cd9a31fbdc71b94ba4d8679 (diff)
dba33b: merge CWS head with head resulting from pulling DEV300_m67
-rw-r--r--bridges/prj/build.lst1
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx18
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx145
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx728
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx337
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/makefile.mk86
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx102
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx524
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx27
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx2
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx10
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx2
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/call.s3
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx28
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx25
-rw-r--r--bridges/source/cpp_uno/shared/vtablefactory.cxx10
-rw-r--r--cppuhelper/inc/cppuhelper/weak.hxx6
-rwxr-xr-xcppuhelper/source/cc5_solaris_sparc.map5
-rw-r--r--cppuhelper/source/component.cxx4
-rw-r--r--cppuhelper/source/gcc3.map6
-rw-r--r--cppuhelper/source/implbase.cxx4
-rw-r--r--cppuhelper/source/msvc_win32_intel.map5
-rw-r--r--cppuhelper/source/tdmgr.cxx12
-rw-r--r--cppuhelper/source/weak.cxx34
-rw-r--r--idlc/inc/idlc/options.hxx4
-rw-r--r--idlc/source/idlcmain.cxx31
-rw-r--r--idlc/source/options.cxx18
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx6
-rw-r--r--offapi/com/sun/star/awt/XTopWindow2.idl76
-rw-r--r--offapi/com/sun/star/awt/makefile.mk1
-rw-r--r--offapi/com/sun/star/document/DocumentEvent.idl1
-rw-r--r--offapi/com/sun/star/document/XDocumentEventBroadcaster.idl1
-rw-r--r--offapi/com/sun/star/document/XDocumentEventListener.idl1
-rw-r--r--offapi/com/sun/star/modules.idl3
-rw-r--r--offapi/com/sun/star/presentation/XSlideShow.idl37
-rw-r--r--offapi/com/sun/star/presentation/XSlideShowController.idl8
-rw-r--r--offapi/com/sun/star/presentation/XSlideShowListener.idl6
-rw-r--r--offapi/util/makefile.mk12
-rw-r--r--offapi/util/target.pmk4
-rw-r--r--pyuno/source/loader/makefile.mk2
-rw-r--r--pyuno/source/module/makefile.mk2
-rw-r--r--pyuno/source/module/pyuno_gc.cxx10
-rw-r--r--pyuno/zipcore/python.cxx10
-rw-r--r--registry/source/keyimpl.cxx4
-rw-r--r--registry/source/regimpl.cxx5
-rw-r--r--registry/test/testmerge.cxx22
-rw-r--r--sal/osl/unx/file.cxx45
-rw-r--r--sal/osl/w32/file.cxx43
-rw-r--r--sal/rtl/source/macro.hxx2
-rw-r--r--sal/typesconfig/typesconfig.c2
-rw-r--r--stoc/prj/build.lst2
-rw-r--r--store/source/stordata.hxx2
-rw-r--r--udkapi/util/target.pmk4
53 files changed, 2366 insertions, 122 deletions
diff --git a/bridges/prj/build.lst b/bridges/prj/build.lst
index 430c49e8a849..c6e342520672 100644
--- a/bridges/prj/build.lst
+++ b/bridges/prj/build.lst
@@ -21,6 +21,7 @@ br bridges\source\cpp_uno\gcc3_linux_s390x nmake - u br_gccl3x br_unotypes br_i
br bridges\source\cpp_uno\gcc3_linux_sparc nmake - u br_gccl3s br_unotypes br_cppuno_shared br_inc NULL
br bridges\source\cpp_uno\gcc3_linux_arm nmake - u br_gccl3r br_unotypes NULL
br bridges\source\cpp_uno\gcc3_linux_ia64 nmake - u br_gccl3a br_unotypes NULL
+br bridges\source\cpp_uno\gcc3_linux_hppa nmake - u br_gccl3h br_unotypes NULL
br bridges\source\cpp_uno\gcc3_macosx_intel nmake - u br_gcc3macoxi br_cppuno_shared br_unotypes br_inc NULL
br bridges\source\cpp_uno\gcc3_macosx_powerpc nmake - u br_gcc3macoxp br_cppuno_shared br_unotypes br_inc NULL
br bridges\source\cpp_uno\cc50_solaris_sparc nmake - u br_cc50sols br_unotypes br_cppuno_shared br_inc NULL
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
index b365bdb8aee1..f59a16b2ac38 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
@@ -45,7 +45,17 @@
#include <stdio.h>
#include <string.h>
-#if defined(__ARM_EABI__) && !defined(__SOFTFP__)
+/*
+ * Based on http://gcc.gnu.org/PR41443
+ * References to __SOFTFP__ are incorrect for EABI; the __SOFTFP__ code
+ * should be used for *soft-float ABI* whether or not VFP is enabled,
+ * and __SOFTFP__ does specifically mean soft-float not soft-float ABI.
+ *
+ * Changing the conditionals to __SOFTFP__ || __ARM_EABI__ then
+ * -mfloat-abi=softfp should work. -mfloat-abi=hard won't; that would
+ * need both a new macro to identify the hard-VFP ABI.
+ */
+#if !defined(__ARM_EABI__) && !defined(__SOFTFP__)
#error Not Implemented
/*
@@ -103,7 +113,7 @@ namespace arm
void MapReturn(long r0, long r1, typelib_TypeClass eReturnType, void *pRegisterReturn)
{
-#ifndef __SOFTFP__
+#if !defined(__ARM_EABI__) && !defined(__SOFTFP__)
register float fret asm("f0");
register double dret asm("f0");
#endif
@@ -128,14 +138,14 @@ void MapReturn(long r0, long r1, typelib_TypeClass eReturnType, void *pRegisterR
*(unsigned char*)pRegisterReturn = (unsigned char)r0;
break;
case typelib_TypeClass_FLOAT:
-#ifdef __SOFTFP__
+#if defined(__ARM_EABI__) || defined(__SOFTFP__)
((long*)pRegisterReturn)[0] = r0;
#else
*(float*)pRegisterReturn = fret;
#endif
break;
case typelib_TypeClass_DOUBLE:
-#ifdef __SOFTFP__
+#if defined(__ARM_EABI__) || defined(__SOFTFP__)
((long*)pRegisterReturn)[1] = r1;
((long*)pRegisterReturn)[0] = r0;
#else
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx
new file mode 100644
index 000000000000..cd30e224bef5
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: uno2cpp.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <malloc.h>
+#include <rtl/alloc.h>
+
+#include <com/sun/star/uno/genfunc.hxx>
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include <uno/data.h>
+
+#include <bridges/cpp_uno/shared/bridge.hxx>
+#include <bridges/cpp_uno/shared/types.hxx>
+#include <bridges/cpp_uno/shared/unointerfaceproxy.hxx>
+#include <bridges/cpp_uno/shared/vtables.hxx>
+
+#include "share.hxx"
+
+#include <stdio.h>
+#include <string.h>
+
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+
+void MapReturn(sal_uInt32 ret0, sal_uInt32 ret1, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn, sal_uInt32 *pRegisterReturn)
+{
+ register float fret asm("fr4");
+ register double dret asm("fr4");
+
+ switch (pReturnTypeDescr->eTypeClass)
+ {
+ case typelib_TypeClass_HYPER:
+ case typelib_TypeClass_UNSIGNED_HYPER:
+ pRegisterReturn[1] = ret1;
+ case typelib_TypeClass_LONG:
+ case typelib_TypeClass_UNSIGNED_LONG:
+ case typelib_TypeClass_ENUM:
+ case typelib_TypeClass_CHAR:
+ case typelib_TypeClass_SHORT:
+ case typelib_TypeClass_UNSIGNED_SHORT:
+ case typelib_TypeClass_BOOLEAN:
+ case typelib_TypeClass_BYTE:
+ pRegisterReturn[0] = ret0;
+ break;
+ case typelib_TypeClass_FLOAT:
+ *(float*)pRegisterReturn = fret;
+ break;
+ case typelib_TypeClass_DOUBLE:
+ *(double*)pRegisterReturn = dret;
+ break;
+ case typelib_TypeClass_STRUCT:
+ case typelib_TypeClass_EXCEPTION:
+ {
+ if (bRegisterReturn)
+ {
+ pRegisterReturn[0] = ret0;
+ pRegisterReturn[1] = ret1;
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+//Moved callVirtual into this .cxx so that I can do this and get gcc to not
+//touch r28 without having to learn any more pa-risc assembly than is
+//strictly necessary
+register sal_uInt32 r28 __asm__("%r28");
+
+void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
+ void * pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn,
+ sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR) __attribute__((noinline));
+
+void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
+ void * pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn,
+ sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR)
+{
+ register sal_uInt32* sp __asm__("%r30");
+
+ sal_uInt32 pMethod = *((sal_uInt32*)pThis);
+ pMethod += 4 * nVtableIndex;
+ pMethod = *((sal_uInt32 *)pMethod);
+
+#ifdef CMC_DEBUG
+ fprintf(stderr, "this is %p\n", pGPR[0]);
+ for (int i = 0; i < hppa::MAX_GPR_REGS ; ++i)
+ fprintf(stderr, "normal reg %d is %d %x\n", i, pGPR[i], pGPR[i]);
+
+ for (int i = 0; i < hppa::MAX_SSE_REGS ; ++i)
+ fprintf(stderr, "float reg %d is %x\n", i, pFPR[i]);
+
+ for (int i = 0; i < nStack; ++i)
+ fprintf(stderr, "stack bytes are %x\n", pStack[i]);
+#endif
+
+ //Always reserve 4 slots, and align to 8 bytes
+ sal_uInt32 nStackBytes = ( ( nStack + 4 + 1 ) >> 1 ) * 8;
+ __builtin_alloca(nStackBytes);
+ sal_uInt32 *stack = sp-8;
+ int o = -5;
+ for (sal_uInt32 i = 0; i < nStack; ++i, --o)
+ stack[o] = pStack[i];
+
+ typedef int (* FunctionCall )( sal_uInt32, sal_uInt32, sal_uInt32, sal_uInt32 );
+ FunctionCall pFunc = (FunctionCall)pMethod;
+
+ asm volatile("fldd %0, %%fr4" : : "m"(pFPR[0]) : "fr4");
+ asm volatile("fldd %0, %%fr5" : : "m"(pFPR[1]) : "fr5");
+ asm volatile("fldd %0, %%fr6" : : "m"(pFPR[2]) : "fr6");
+ asm volatile("fldd %0, %%fr7" : : "m"(pFPR[3]) : "fr7");
+ asm volatile("ldw %0, %%r28" : : "m"(pRegisterReturn) : "r28");
+ (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3]);
+
+ register sal_uInt32 r29 __asm__("%r29");
+ MapReturn(r28, r29, pReturnTypeDescr, bRegisterReturn, (sal_uInt32*)pRegisterReturn);
+}
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx
new file mode 100644
index 000000000000..a78d7694c798
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx
@@ -0,0 +1,728 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: cpp2uno.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <malloc.h>
+#include <hash_map>
+
+#include <rtl/alloc.h>
+#include <osl/mutex.hxx>
+
+#include <com/sun/star/uno/genfunc.hxx>
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include <uno/data.h>
+#include <typelib/typedescription.hxx>
+
+#include "bridges/cpp_uno/shared/bridge.hxx"
+#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx"
+#include "bridges/cpp_uno/shared/types.hxx"
+#include "bridges/cpp_uno/shared/vtablefactory.hxx"
+
+#include "share.hxx"
+
+#include <dlfcn.h>
+
+
+using namespace ::osl;
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+
+namespace
+{
+
+ static typelib_TypeClass cpp2uno_call(
+ bridges::cpp_uno::shared::CppInterfaceProxy* pThis,
+ const typelib_TypeDescription * pMemberTypeDescr,
+ typelib_TypeDescriptionReference * pReturnTypeRef,
+ sal_Int32 nParams, typelib_MethodParameter * pParams,
+ long r8, void ** gpreg, double *fpreg, void ** ovrflw,
+ sal_Int64 * pRegisterReturn /* space for register return */ )
+ {
+ void ** startovrflw;
+ int nregs = 0; //number of words passed in registers
+
+#ifdef CMC_DEBUG
+ fprintf(stderr, "cpp2uno_call\n");
+#endif
+ // return
+ typelib_TypeDescription * pReturnTypeDescr = 0;
+ if (pReturnTypeRef)
+ TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
+
+ void * pUnoReturn = 0;
+ // complex return ptr: if != 0 && != pUnoReturn, reconversion need
+ void * pCppReturn = 0;
+
+ if (pReturnTypeDescr)
+ {
+ if (hppa::isRegisterReturn(pReturnTypeRef))
+ {
+#ifdef CMC_DEBUG
+ fprintf(stderr, "simple return\n");
+#endif
+ pUnoReturn = pRegisterReturn; // direct way for simple types
+ }
+ else
+ {
+#ifdef CMC_DEBUG
+ fprintf(stderr, "complex return via r8\n");
+#endif
+ pCppReturn = (void *)r8;
+
+ pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr )
+ ? alloca( pReturnTypeDescr->nSize )
+ : pCppReturn); // direct way
+ }
+ }
+ // pop this
+ gpreg++;
+ fpreg++;
+ nregs++;
+
+ // stack space
+ OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
+ // parameters
+ void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams );
+ void ** pCppArgs = pUnoArgs + nParams;
+ // indizes of values this have to be converted (interface conversion
+ // cpp<=>uno)
+ sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams));
+ // type descriptions for reconversions
+ typelib_TypeDescription ** ppTempParamTypeDescr =
+ (typelib_TypeDescription **)(pUnoArgs + (3 * nParams));
+
+ sal_Int32 nTempIndizes = 0;
+ bool bOverFlowUsed = false;
+ for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
+ {
+ const typelib_MethodParameter & rParam = pParams[nPos];
+ typelib_TypeDescription * pParamTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
+
+ if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
+ {
+ switch (pParamTypeDescr->eTypeClass)
+ {
+ case typelib_TypeClass_DOUBLE:
+ if (nregs < hppa::MAX_WORDS_IN_REGS && (nregs & 1))
+ {
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ if (nregs < hppa::MAX_WORDS_IN_REGS-1)
+ {
+ fpreg++;
+ pCppArgs[nPos] = pUnoArgs[nPos] = fpreg;
+ gpreg+=2;
+ fpreg+=2;
+ nregs+=2;
+ }
+ else
+ {
+ if ((startovrflw-ovrflw) & 4)
+ ovrflw--;
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw - 4);
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw-=2;
+ break;
+ case typelib_TypeClass_FLOAT:
+ if (nregs < hppa::MAX_WORDS_IN_REGS)
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = fpreg;
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ else
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw;
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw--;
+ break;
+ case typelib_TypeClass_HYPER:
+ case typelib_TypeClass_UNSIGNED_HYPER:
+ if (nregs < hppa::MAX_WORDS_IN_REGS && (nregs & 1))
+ {
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ if (nregs < hppa::MAX_WORDS_IN_REGS-1)
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = gpreg;
+ gpreg+=2;
+ fpreg+=2;
+ nregs+=2;
+ }
+ else
+ {
+ if ((startovrflw-ovrflw) & 4)
+ ovrflw--;
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw - 4);
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw-=2;
+ break;
+ case typelib_TypeClass_BYTE:
+ case typelib_TypeClass_BOOLEAN:
+ if (nregs < hppa::MAX_WORDS_IN_REGS)
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)gpreg + 3);
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ else
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw+3);
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw--;
+ break;
+ case typelib_TypeClass_CHAR:
+ case typelib_TypeClass_SHORT:
+ case typelib_TypeClass_UNSIGNED_SHORT:
+ if (nregs < hppa::MAX_WORDS_IN_REGS)
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)gpreg+2);
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ else
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ((char*)ovrflw+2);
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw--;
+ break;
+ case typelib_TypeClass_ENUM:
+ case typelib_TypeClass_LONG:
+ case typelib_TypeClass_UNSIGNED_LONG:
+ default:
+ if (nregs < hppa::MAX_WORDS_IN_REGS)
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = gpreg;
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ else
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos] = ovrflw;
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw--;
+ break;
+ }
+ // no longer needed
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ else // ptr to complex value | ref
+ {
+ void *pCppStack;
+
+ if (nregs < hppa::MAX_WORDS_IN_REGS)
+ {
+ pCppArgs[nPos] = pCppStack = *gpreg;
+ gpreg++;
+ fpreg++;
+ nregs++;
+ }
+ else
+ {
+ pCppArgs[nPos] = pCppStack = *ovrflw;
+ bOverFlowUsed = true;
+ }
+ if (bOverFlowUsed) ovrflw--;
+
+ if (! rParam.bIn) // is pure out
+ {
+ // uno out is unconstructed mem!
+ pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize );
+ pTempIndizes[nTempIndizes] = nPos;
+ // will be released at reconversion
+ ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+ }
+ // is in/inout
+ else if (bridges::cpp_uno::shared::relatesToInterfaceType(
+ pParamTypeDescr ))
+ {
+ uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ),
+ pCppStack, pParamTypeDescr,
+ pThis->getBridge()->getCpp2Uno() );
+ pTempIndizes[nTempIndizes] = nPos; // has to be reconverted
+ // will be released at reconversion
+ ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+ }
+ else // direct way
+ {
+ pUnoArgs[nPos] = pCppStack;
+ // no longer needed
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ }
+ }
+
+ // ExceptionHolder
+ uno_Any aUnoExc; // Any will be constructed by callee
+ uno_Any * pUnoExc = &aUnoExc;
+
+#ifdef CMC_DEBUG
+ fprintf(stderr, "before dispatch\n");
+#endif
+ // invoke uno dispatch call
+ (*pThis->getUnoI()->pDispatcher)(
+ pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc );
+
+#ifdef CMC_DEBUG
+ fprintf(stderr, "after dispatch\n");
+#endif
+
+ // in case an exception occured...
+ if (pUnoExc)
+ {
+ // destruct temporary in/inout params
+ for ( ; nTempIndizes--; )
+ {
+ sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+
+ if (pParams[nIndex].bIn) // is in/inout => was constructed
+ uno_destructData( pUnoArgs[nIndex],
+ ppTempParamTypeDescr[nTempIndizes], 0 );
+ TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] );
+ }
+ if (pReturnTypeDescr)
+ TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+
+ CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc,
+ pThis->getBridge()->getUno2Cpp() ); // has to destruct the any
+ // is here for dummy
+ return typelib_TypeClass_VOID;
+ }
+ else // else no exception occured...
+ {
+ // temporary params
+ for ( ; nTempIndizes--; )
+ {
+ sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+ typelib_TypeDescription * pParamTypeDescr =
+ ppTempParamTypeDescr[nTempIndizes];
+
+ if (pParams[nIndex].bOut) // inout/out
+ {
+ // convert and assign
+ uno_destructData( pCppArgs[nIndex], pParamTypeDescr,
+ cpp_release );
+ uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex],
+ pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
+ }
+ // destroy temp uno param
+ uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 );
+
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ // return
+ if (pCppReturn) // has complex return
+ {
+ if (pUnoReturn != pCppReturn) // needs reconversion
+ {
+ uno_copyAndConvertData( pCppReturn, pUnoReturn,
+ pReturnTypeDescr, pThis->getBridge()->getUno2Cpp() );
+ // destroy temp uno return
+ uno_destructData( pUnoReturn, pReturnTypeDescr, 0 );
+ }
+ // complex return ptr is set to eax
+ *(void **)pRegisterReturn = pCppReturn;
+ }
+ if (pReturnTypeDescr)
+ {
+ typelib_TypeClass eRet =
+ (typelib_TypeClass)pReturnTypeDescr->eTypeClass;
+ TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+ return eRet;
+ }
+ else
+ return typelib_TypeClass_VOID;
+ }
+ }
+
+
+ //=====================================================================
+ static typelib_TypeClass cpp_mediate(
+ sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset,
+ void ** gpreg, double* fpreg,
+ long sp, long r8,
+ sal_Int64 * pRegisterReturn /* space for register return */ )
+
+ {
+ void ** ovrflw = (void**)(sp);
+#ifdef CMC_DEBUG
+ fprintf(stderr, "cpp_mediate with\n");
+ fprintf(stderr, "%x %x\n", nFunctionIndex, nVtableOffset);
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[0]), (long)(ovrflw[-1]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-2]), (long)(ovrflw[-3]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-4]), (long)(ovrflw[-5]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-6]), (long)(ovrflw[-7]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-8]), (long)(ovrflw[-9]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-10]), (long)(ovrflw[-11]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-12]), (long)(ovrflw[-13]));
+ fprintf(stderr, "and %x %x\n", (long)(ovrflw[-14]), (long)(ovrflw[-15]));
+#endif
+ OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" );
+
+ // gpreg: [ret *], this, [other gpr params]
+ // fpreg: [fpr params]
+ // ovrflw: [gpr or fpr params (properly aligned)]
+
+ void * pThis;
+ if (nFunctionIndex & 0x80000000 )
+ {
+ nFunctionIndex &= 0x7fffffff;
+ pThis = gpreg[1];
+#ifdef CMC_DEBUG
+ fprintf(stderr, "pThis is gpreg[1]\n");
+#endif
+ }
+ else
+ {
+ pThis = gpreg[0];
+#ifdef CMC_DEBUG
+ fprintf(stderr, "pThis is gpreg[0]\n");
+#endif
+ }
+
+ pThis = static_cast< char * >(pThis) - nVtableOffset;
+
+ bridges::cpp_uno::shared::CppInterfaceProxy * pCppI =
+ bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(
+ pThis);
+
+ typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr();
+
+ OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex,
+ "### illegal vtable index!" );
+ if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex)
+ {
+ throw RuntimeException(
+ OUString::createFromAscii("illegal vtable index!"),
+ (XInterface *)pCppI );
+ }
+
+ // determine called method
+ OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex,
+ "### illegal vtable index!" );
+ sal_Int32 nMemberPos =
+ pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex];
+ OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers,
+ "### illegal member index!" );
+
+ TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
+
+ typelib_TypeClass eRet;
+ switch (aMemberDescr.get()->eTypeClass)
+ {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ {
+ if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] ==
+ nFunctionIndex)
+ {
+ // is GET method
+ eRet = cpp2uno_call(
+ pCppI, aMemberDescr.get(),
+ ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef,
+ 0, 0, // no params
+ r8, gpreg, fpreg, ovrflw, pRegisterReturn );
+ }
+ else
+ {
+ // is SET method
+ typelib_MethodParameter aParam;
+ aParam.pTypeRef =
+ ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef;
+ aParam.bIn = sal_True;
+ aParam.bOut = sal_False;
+
+ eRet = cpp2uno_call(
+ pCppI, aMemberDescr.get(),
+ 0, // indicates void return
+ 1, &aParam,
+ r8, gpreg, fpreg, ovrflw, pRegisterReturn );
+ }
+ break;
+ }
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ // is METHOD
+ switch (nFunctionIndex)
+ {
+ case 1: // acquire()
+ pCppI->acquireProxy(); // non virtual call!
+ eRet = typelib_TypeClass_VOID;
+ break;
+ case 2: // release()
+ pCppI->releaseProxy(); // non virtual call!
+ eRet = typelib_TypeClass_VOID;
+ break;
+ case 0: // queryInterface() opt
+ {
+ typelib_TypeDescription * pTD = 0;
+ TYPELIB_DANGER_GET(&pTD,
+ reinterpret_cast<Type *>(gpreg[1])->getTypeLibType());
+ if (pTD)
+ {
+ XInterface * pInterface = 0;
+ (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)(
+ pCppI->getBridge()->getCppEnv(),
+ (void **)&pInterface, pCppI->getOid().pData,
+ (typelib_InterfaceTypeDescription *)pTD );
+
+ if (pInterface)
+ {
+ ::uno_any_construct(
+ reinterpret_cast< uno_Any * >( r8 ),
+ &pInterface, pTD, cpp_acquire );
+ pInterface->release();
+ TYPELIB_DANGER_RELEASE( pTD );
+ *(void **)pRegisterReturn = (void*)r8;
+ eRet = typelib_TypeClass_ANY;
+ break;
+ }
+ TYPELIB_DANGER_RELEASE( pTD );
+ }
+ } // else perform queryInterface()
+ default:
+ eRet = cpp2uno_call(
+ pCppI, aMemberDescr.get(),
+ ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef,
+ ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams,
+ ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams,
+ r8, gpreg, fpreg, ovrflw, pRegisterReturn );
+ }
+ break;
+ }
+ default:
+ {
+ throw RuntimeException(
+ OUString::createFromAscii("no member description found!"),
+ (XInterface *)pCppI );
+ // is here for dummy
+ eRet = typelib_TypeClass_VOID;
+ }
+ }
+
+ return eRet;
+ }
+}
+
+//=======================================================================
+/**
+ * is called on incoming vtable calls
+ * (called by asm snippets)
+ */
+
+sal_Int64 cpp_vtable_call( sal_uInt32 in0, sal_uInt32 in1, sal_uInt32 in2, sal_uInt32 in3, sal_uInt32 firstonstack )
+{
+ register sal_Int32 r21 asm("r21");
+ register sal_Int32 r22 asm("r22");
+ register sal_Int32 r28 asm("r28");
+ sal_Int32 functionIndex = r21;
+ sal_Int32 vtableOffset = r22;
+ sal_Int32 r8 = r28;
+
+ long sp = (long)&firstonstack;
+
+ sal_uInt32 gpreg[hppa::MAX_GPR_REGS];
+ gpreg[0] = in0;
+ gpreg[1] = in1;
+ gpreg[2] = in2;
+ gpreg[3] = in3;
+
+ float fpreg[hppa::MAX_SSE_REGS]; //todo
+ register float f0 asm("fr4"); fpreg[0] = f0;
+ register float f1 asm("fr5"); fpreg[1] = f1;
+ register float f2 asm("fr6"); fpreg[2] = f2;
+ register float f3 asm("fr7"); fpreg[3] = f3;
+
+ double dpreg[hppa::MAX_SSE_REGS]; //todo
+ register double d0 asm("fr4"); dpreg[0] = d0;
+ register double d1 asm("fr5"); dpreg[1] = d1;
+ register double d2 asm("fr6"); dpreg[2] = d2;
+ register double d3 asm("fr7"); dpreg[3] = d3;
+
+
+#ifdef CMC_DEBUG
+ fprintf(stderr, "got to cpp_vtable_call with %x %x\n", functionIndex, vtableOffset);
+ for (int i = 0; i < hppa::MAX_GPR_REGS; ++i)
+ fprintf(stderr, "reg %d is %d %x\n", i, gpreg[i], gpreg[i]);
+ for (int i = 0; i < hppa::MAX_SSE_REGS; ++i)
+ fprintf(stderr, "float reg %d is %f %x\n", i, fpreg[i], ((long*)fpreg)[i]);
+ for (int i = 0; i < 4; ++i)
+ fprintf(stderr, "double reg %d is %f %llx\n", i, dpreg[i], ((long long*)dpreg)[i]);
+#endif
+
+ sal_Int64 nRegReturn;
+
+ typelib_TypeClass aType =
+ cpp_mediate( functionIndex, vtableOffset, (void**)gpreg, dpreg, sp, r8, &nRegReturn);
+
+ switch( aType )
+ {
+ case typelib_TypeClass_FLOAT:
+ f0 = (*((float*)&nRegReturn));
+ break;
+ case typelib_TypeClass_DOUBLE:
+ d0 = (*((double*)&nRegReturn));
+ break;
+ default:
+ break;
+ }
+
+ return nRegReturn;
+}
+
+
+namespace
+{
+ const int codeSnippetSize = 44;
+
+# define unldil(v) (((v & 0x7c) << 14) | ((v & 0x180) << 7) | ((v & 0x3) << 12) | ((v & 0xffe00) >> 8) | ((v & 0x100000) >> 20))
+# define L21(v) unldil(((unsigned long)(v) >> 11) & 0x1fffff) //Left 21 bits
+# define R11(v) (((unsigned long)(v) & 0x7FF) << 1) //Right 11 bits
+
+ unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex,
+ sal_Int32 vtableOffset, bool bHasHiddenParam)
+ {
+ if (bHasHiddenParam)
+ functionIndex |= 0x80000000;
+
+ unsigned char * p = code;
+ *(unsigned long*)&p[0] = 0xeaa00000; // b,l 0x8,r21
+ *(unsigned long*)&p[4] = 0xd6a01c1e; // depwi 0,31,2,r21
+ *(unsigned long*)&p[8] = 0x4aa10040; // ldw 32(r21),r1
+
+ *(unsigned long*)&p[12] = 0x22A00000 | L21(functionIndex); // ldil L<functionIndex>,r21
+ *(unsigned long*)&p[16] = 0x36B50000 | R11(functionIndex); // ldo R<functionIndex>,r21
+
+ *(unsigned long*)&p[20] = 0x22C00000 | L21(vtableOffset); // ldil L<vtableOffset>,r22
+ *(unsigned long*)&p[24] = 0x36D60000 | R11(vtableOffset); // ldo R<vtableOffset>,r22
+
+ *(unsigned long*)&p[28] = 0x0c201094; // ldw 0(r1),r20
+ *(unsigned long*)&p[32] = 0xea80c000; // bv r0(r20)
+ *(unsigned long*)&p[36] = 0x0c281093; // ldw 4(r1),r19
+ *(unsigned long*)&p[40] = ((unsigned long)(cpp_vtable_call) & ~2);
+
+ return code + codeSnippetSize;
+ }
+}
+
+struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; };
+
+bridges::cpp_uno::shared::VtableFactory::Slot *
+bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block)
+{
+ return static_cast< Slot * >(block) + 2;
+}
+
+sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize(
+ sal_Int32 slotCount)
+{
+ return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize;
+}
+
+bridges::cpp_uno::shared::VtableFactory::Slot *
+bridges::cpp_uno::shared::VtableFactory::initializeBlock(
+ void * block, sal_Int32 slotCount)
+{
+ Slot * slots = mapBlockToVtable(block);
+ slots[-2].fn = 0;
+ slots[-1].fn = 0;
+ return slots + slotCount;
+}
+
+unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
+ Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff,
+ typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
+ sal_Int32 functionCount, sal_Int32 vtableOffset)
+{
+ (*slots) -= functionCount;
+ Slot * s = *slots;
+ for (sal_Int32 i = 0; i < type->nMembers; ++i)
+ {
+ typelib_TypeDescription * member = 0;
+ TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
+ OSL_ASSERT(member != 0);
+ switch (member->eTypeClass)
+ {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ // Getter:
+ (s++)->fn = code + writetoexecdiff;
+ code = codeSnippet(code, functionOffset++, vtableOffset, false);
+ // Setter:
+ if (!reinterpret_cast<
+ typelib_InterfaceAttributeTypeDescription * >(
+ member)->bReadOnly)
+ {
+ (s++)->fn = code + writetoexecdiff;
+ code = codeSnippet(code, functionOffset++, vtableOffset, false);
+ }
+ break;
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+ (s++)->fn = code + writetoexecdiff;
+ code = codeSnippet(code, functionOffset++, vtableOffset, false);
+ break;
+ }
+ default:
+ OSL_ASSERT(false);
+ break;
+ }
+ TYPELIB_DANGER_RELEASE(member);
+ }
+ return code;
+}
+
+void bridges::cpp_uno::shared::VtableFactory::flushCode(
+ unsigned char const *beg, unsigned char const *end)
+{
+ void *p = (void*)((size_t)beg & ~31);
+ size_t stride = 32;
+ while (p < end)
+ {
+ asm volatile("fdc (%0)\n\t"
+ "sync\n\t"
+ "fic,m %1(%%sr4, %0)\n\t"
+ "sync" : "+r"(p) : "r"(stride) : "memory");
+ }
+}
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx
new file mode 100644
index 000000000000..8242bacaedc6
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx
@@ -0,0 +1,337 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: except.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <dlfcn.h>
+#include <cxxabi.h>
+#include <hash_map>
+
+#include <rtl/strbuf.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <osl/diagnose.h>
+#include <osl/mutex.hxx>
+
+#include <com/sun/star/uno/genfunc.hxx>
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include <typelib/typedescription.hxx>
+#include <uno/any2.h>
+
+#include "share.hxx"
+
+
+using namespace ::std;
+using namespace ::osl;
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+using namespace ::__cxxabiv1;
+
+extern sal_Int32 * pHack;
+extern sal_Int32 nHack;
+
+namespace CPPU_CURRENT_NAMESPACE
+{
+ void dummy_can_throw_anything( char const * )
+ {
+ }
+
+ //===================================================================
+ static OUString toUNOname( char const * p ) SAL_THROW( () )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ char const * start = p;
+#endif
+
+ // example: N3com3sun4star4lang24IllegalArgumentExceptionE
+
+ OUStringBuffer buf( 64 );
+ OSL_ASSERT( 'N' == *p );
+ ++p; // skip N
+
+ while ('E' != *p)
+ {
+ // read chars count
+ long n = (*p++ - '0');
+ while ('0' <= *p && '9' >= *p)
+ {
+ n *= 10;
+ n += (*p++ - '0');
+ }
+ buf.appendAscii( p, n );
+ p += n;
+ if ('E' != *p)
+ buf.append( (sal_Unicode)'.' );
+ }
+
+#if OSL_DEBUG_LEVEL > 1
+ OUString ret( buf.makeStringAndClear() );
+ OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) );
+ fprintf( stderr, "> toUNOname(): %s => %s\n", start, c_ret.getStr() );
+ return ret;
+#else
+ return buf.makeStringAndClear();
+#endif
+ }
+
+ //=====================================================================
+ class RTTI
+ {
+ typedef hash_map< OUString, type_info *, OUStringHash > t_rtti_map;
+
+ Mutex m_mutex;
+ t_rtti_map m_rttis;
+ t_rtti_map m_generatedRttis;
+
+ void * m_hApp;
+
+ public:
+ RTTI() SAL_THROW( () );
+ ~RTTI() SAL_THROW( () );
+
+ type_info * getRTTI(typelib_CompoundTypeDescription *) SAL_THROW( () );
+ };
+ //____________________________________________________________________
+ RTTI::RTTI() SAL_THROW( () )
+ : m_hApp( dlopen( 0, RTLD_LAZY ) )
+ {
+ }
+ //____________________________________________________________________
+ RTTI::~RTTI() SAL_THROW( () )
+ {
+ dlclose( m_hApp );
+ }
+
+ //____________________________________________________________________
+ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW( () )
+ {
+ type_info * rtti;
+
+ OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName;
+
+ MutexGuard guard( m_mutex );
+ t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) );
+ if (iRttiFind == m_rttis.end())
+ {
+ // RTTI symbol
+ OStringBuffer buf( 64 );
+ buf.append( RTL_CONSTASCII_STRINGPARAM("_ZTIN") );
+ sal_Int32 index = 0;
+ do
+ {
+ OUString token( unoName.getToken( 0, '.', index ) );
+ buf.append( token.getLength() );
+ OString c_token( OUStringToOString( token, RTL_TEXTENCODING_ASCII_US ) );
+ buf.append( c_token );
+ }
+ while (index >= 0);
+ buf.append( 'E' );
+
+ OString symName( buf.makeStringAndClear() );
+ rtti = (type_info *)dlsym( m_hApp, symName.getStr() );
+
+ if (rtti)
+ {
+ pair< t_rtti_map::iterator, bool > insertion(
+ m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
+ OSL_ENSURE( insertion.second, "### inserting new rtti failed?!" );
+ }
+ else
+ {
+ // try to lookup the symbol in the generated rtti map
+ t_rtti_map::const_iterator iFind( m_generatedRttis.find( unoName ) );
+ if (iFind == m_generatedRttis.end())
+ {
+ // we must generate it !
+ // symbol and rtti-name is nearly identical,
+ // the symbol is prefixed with _ZTI
+ char const * rttiName = symName.getStr() +4;
+#if OSL_DEBUG_LEVEL > 1
+ fprintf( stderr,"generated rtti for %s\n", rttiName );
+#endif
+ if (pTypeDescr->pBaseTypeDescription)
+ {
+ // ensure availability of base
+ type_info * base_rtti = getRTTI(
+ (typelib_CompoundTypeDescription *)pTypeDescr->pBaseTypeDescription );
+ rtti = new __si_class_type_info(
+ strdup( rttiName ), (__class_type_info *)base_rtti );
+ }
+ else
+ {
+ // this class has no base class
+ rtti = new __class_type_info( strdup( rttiName ) );
+ }
+
+ pair< t_rtti_map::iterator, bool > insertion(
+ m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
+ OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" );
+ }
+ else // taking already generated rtti
+ {
+ rtti = iFind->second;
+ }
+ }
+ }
+ else
+ {
+ rtti = iRttiFind->second;
+ }
+
+ return rtti;
+ }
+
+ //------------------------------------------------------------------
+ static void deleteException( void * pExc )
+ {
+ __cxa_exception const * header = ((__cxa_exception const *)pExc - 1);
+ typelib_TypeDescription * pTD = 0;
+ OUString unoName( toUNOname( header->exceptionType->name() ) );
+ ::typelib_typedescription_getByName( &pTD, unoName.pData );
+ OSL_ENSURE( pTD, "### unknown exception type! leaving out destruction => leaking!!!" );
+ if (pTD)
+ {
+ ::uno_destructData( pExc, pTD, cpp_release );
+ ::typelib_typedescription_release( pTD );
+ }
+ }
+
+ //==================================================================
+ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp )
+ {
+#if OSL_DEBUG_LEVEL > 1
+ OString cstr(
+ OUStringToOString(
+ *reinterpret_cast< OUString const * >( &pUnoExc->pType->pTypeName ),
+ RTL_TEXTENCODING_ASCII_US ) );
+ fprintf( stderr, "> uno exception occured: %s\n", cstr.getStr() );
+#endif
+ void * pCppExc;
+ type_info * rtti;
+
+ {
+ // construct cpp exception object
+ typelib_TypeDescription * pTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType );
+ OSL_ASSERT( pTypeDescr );
+ if (! pTypeDescr)
+ {
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("cannot get typedescription for type ") ) +
+ *reinterpret_cast< OUString const * >( &pUnoExc->pType->pTypeName ),
+ Reference< XInterface >() );
+ }
+
+ pCppExc = __cxa_allocate_exception( pTypeDescr->nSize );
+ ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp );
+
+ // destruct uno exception
+ ::uno_any_destruct( pUnoExc, 0 );
+ // avoiding locked counts
+ static RTTI * s_rtti = 0;
+ if (! s_rtti)
+ {
+ MutexGuard guard( Mutex::getGlobalMutex() );
+ if (! s_rtti)
+ {
+#ifdef LEAK_STATIC_DATA
+ s_rtti = new RTTI();
+#else
+ static RTTI rtti_data;
+ s_rtti = &rtti_data;
+#endif
+ }
+ }
+ rtti = (type_info *)s_rtti->getRTTI( (typelib_CompoundTypeDescription *) pTypeDescr );
+ TYPELIB_DANGER_RELEASE( pTypeDescr );
+ OSL_ENSURE( rtti, "### no rtti for throwing exception!" );
+ if (! rtti)
+ {
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("no rtti for type ") ) +
+ *reinterpret_cast< OUString const * >( &pUnoExc->pType->pTypeName ),
+ Reference< XInterface >() );
+ }
+ }
+
+
+ __cxa_throw( pCppExc, rtti, deleteException );
+ }
+
+ static void* getAdjustedPtr(__cxa_exception* header)
+ {
+ return header->adjustedPtr;
+ }
+
+ //===================================================================
+ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping * pCpp2Uno )
+ {
+ if (! header)
+ {
+ RuntimeException aRE(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("no exception header!") ),
+ Reference< XInterface >() );
+ Type const & rType = ::getCppuType( &aRE );
+ uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
+#if OSL_DEBUG_LEVEL > 0
+ OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
+ OSL_ENSURE( 0, cstr.getStr() );
+#endif
+ return;
+ }
+
+ typelib_TypeDescription * pExcTypeDescr = 0;
+ OUString unoName( toUNOname( header->exceptionType->name() ) );
+#if OSL_DEBUG_LEVEL > 1
+ OString cstr_unoName( OUStringToOString( unoName, RTL_TEXTENCODING_ASCII_US ) );
+ fprintf( stderr, "> c++ exception occured: %s\n", cstr_unoName.getStr() );
+#endif
+ typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData );
+ if (0 == pExcTypeDescr)
+ {
+ RuntimeException aRE(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("exception type not found: ") ) + unoName,
+ Reference< XInterface >() );
+ Type const & rType = ::getCppuType( &aRE );
+ uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
+#if OSL_DEBUG_LEVEL > 0
+ OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
+ OSL_ENSURE( 0, cstr.getStr() );
+#endif
+ }
+ else
+ {
+ // construct uno exception any
+ uno_any_constructAndConvert( pUnoExc, getAdjustedPtr(header), pExcTypeDescr, pCpp2Uno );
+ typelib_typedescription_release( pExcTypeDescr );
+ }
+ }
+}
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/makefile.mk b/bridges/source/cpp_uno/gcc3_linux_hppa/makefile.mk
new file mode 100644
index 000000000000..fcdcea72454f
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/makefile.mk
@@ -0,0 +1,86 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.2 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=bridges
+TARGET=gcc3_uno
+LIBTARGET=no
+ENABLE_EXCEPTIONS=TRUE
+NO_BSYMBOLIC=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(COM)$(OS)$(CPU)" == "GCCLINUXH"
+
+.IF "$(cppu_no_leak)" == ""
+CFLAGS += -DLEAK_STATIC_DATA
+.ENDIF
+
+CFLAGSCXX += -fno-omit-frame-pointer
+
+NOOPTFILES= \
+ $(SLO)$/cpp2uno.obj \
+ $(SLO)$/except.obj \
+ $(SLO)$/uno2cpp.obj \
+ $(SLO)$/call.obj
+
+CFLAGSNOOPT=-O0
+
+SLOFILES= \
+ $(SLO)$/cpp2uno.obj \
+ $(SLO)$/except.obj \
+ $(SLO)$/uno2cpp.obj \
+ $(SLO)$/call.obj
+
+SHL1TARGET= $(TARGET)
+
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+SHL1IMPLIB=i$(TARGET)
+SHL1VERSIONMAP=..$/..$/bridge_exports.map
+SHL1RPATH=URELIB
+
+SHL1OBJS = $(SLOFILES)
+SHL1LIBS = $(SLB)$/cpp_uno_shared.lib
+
+SHL1STDLIBS= \
+ $(CPPULIB) \
+ $(SALLIB)
+
+.ENDIF
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx b/bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx
new file mode 100644
index 000000000000..eedfdf75da8d
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: share.hxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "uno/mapping.h"
+
+#include <typeinfo>
+#include <exception>
+#include <cstddef>
+
+namespace CPPU_CURRENT_NAMESPACE
+{
+
+ void dummy_can_throw_anything( char const * );
+
+
+// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h
+
+struct _Unwind_Exception
+{
+ unsigned exception_class __attribute__((__mode__(__DI__)));
+ void * exception_cleanup;
+ unsigned private_1 __attribute__((__mode__(__word__)));
+ unsigned private_2 __attribute__((__mode__(__word__)));
+} __attribute__((__aligned__));
+
+struct __cxa_exception
+{
+ ::std::type_info *exceptionType;
+ void (*exceptionDestructor)(void *);
+
+ ::std::unexpected_handler unexpectedHandler;
+ ::std::terminate_handler terminateHandler;
+
+ __cxa_exception *nextException;
+
+ int handlerCount;
+
+ int handlerSwitchValue;
+ const unsigned char *actionRecord;
+ const unsigned char *languageSpecificData;
+ void *catchTemp;
+ void *adjustedPtr;
+
+ _Unwind_Exception unwindHeader;
+};
+
+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));
+
+struct __cxa_eh_globals
+{
+ __cxa_exception *caughtExceptions;
+ unsigned int uncaughtExceptions;
+};
+extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
+
+// -----
+
+//==================================================================================================
+void raiseException(
+ uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
+//==================================================================================================
+void fillUnoException(
+ __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
+}
+
+
+namespace hppa
+{
+ enum hppalimits { MAX_WORDS_IN_REGS = 4, MAX_GPR_REGS = 4, MAX_SSE_REGS = 4 };
+
+ bool isRegisterReturn( typelib_TypeDescriptionReference *pTypeRef );
+}
diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx
new file mode 100644
index 000000000000..a342568d5bf8
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx
@@ -0,0 +1,524 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: uno2cpp.cxx,v $
+ * $Revision: 1.2 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <malloc.h>
+#include <rtl/alloc.h>
+
+#include <com/sun/star/uno/genfunc.hxx>
+#include "com/sun/star/uno/RuntimeException.hpp"
+#include <uno/data.h>
+
+#include <bridges/cpp_uno/shared/bridge.hxx>
+#include <bridges/cpp_uno/shared/types.hxx>
+#include <bridges/cpp_uno/shared/unointerfaceproxy.hxx>
+#include <bridges/cpp_uno/shared/vtables.hxx>
+
+#include "share.hxx"
+
+#include <stdio.h>
+#include <string.h>
+
+using namespace ::rtl;
+using namespace ::com::sun::star::uno;
+
+void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
+ void * pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn,
+ sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR);
+
+#define INSERT_INT32( pSV, nr, pGPR, pDS, bOverFlow )\
+ if (nr < hppa::MAX_WORDS_IN_REGS) \
+ { \
+ pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
+ } \
+ else \
+ bOverFlow = true; \
+ if (bOverFlow) \
+ *pDS++ = *reinterpret_cast<sal_uInt32 *>( pSV );
+
+#define INSERT_INT64( pSV, nr, pGPR, pDS, pStart, bOverFlow )\
+ if ( (nr < hppa::MAX_WORDS_IN_REGS) && (nr % 2) ) \
+ { \
+ ++nr; \
+ } \
+ if ( nr < hppa::MAX_WORDS_IN_REGS ) \
+ { \
+ pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
+ pGPR[nr++] = *(reinterpret_cast<sal_uInt32 *>( pSV ) + 1); \
+ } \
+ else \
+ bOverFlow = true; \
+ if ( bOverFlow ) \
+ { \
+ if ( (pDS - pStart) % 2) \
+ ++pDS; \
+ *pDS++ = reinterpret_cast<sal_uInt32 *>( pSV )[1]; \
+ *pDS++ = reinterpret_cast<sal_uInt32 *>( pSV )[0]; \
+ }
+
+#define INSERT_FLOAT( pSV, nr, pFPR, pDS, bOverFlow ) \
+ if (nr < hppa::MAX_WORDS_IN_REGS) \
+ { \
+ sal_uInt32 *pDouble = (sal_uInt32 *)&(pFPR[nr++]); \
+ pDouble[0] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
+ } \
+ else \
+ bOverFlow = true; \
+ if (bOverFlow) \
+ *pDS++ = *reinterpret_cast<sal_uInt32 *>( pSV );
+
+#define INSERT_DOUBLE( pSV, nr, pFPR, pDS, pStart, bOverFlow ) \
+ if ( (nr < hppa::MAX_WORDS_IN_REGS) && (nr % 2) ) \
+ { \
+ ++nr; \
+ } \
+ if ( nr < hppa::MAX_WORDS_IN_REGS ) \
+ { \
+ sal_uInt32 *pDouble = (sal_uInt32 *)&(pFPR[nr+1]); \
+ pDouble[0] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
+ pDouble[1] = *(reinterpret_cast<sal_uInt32 *>( pSV ) + 1); \
+ nr+=2; \
+ } \
+ else \
+ bOverFlow = true; \
+ if ( bOverFlow ) \
+ { \
+ if ( (pDS - pStart) % 2) \
+ ++pDS; \
+ *pDS++ = reinterpret_cast<sal_uInt32 *>( pSV )[1]; \
+ *pDS++ = reinterpret_cast<sal_uInt32 *>( pSV )[0]; \
+ }
+
+#define INSERT_INT16( pSV, nr, pGPR, pDS, bOverFlow ) \
+ if ( nr < hppa::MAX_WORDS_IN_REGS ) \
+ pGPR[nr++] = *reinterpret_cast<sal_uInt16 *>( pSV ); \
+ else \
+ bOverFlow = true; \
+ if (bOverFlow) \
+ *pDS++ = *reinterpret_cast<sal_uInt16 *>( pSV );
+
+#define INSERT_INT8( pSV, nr, pGPR, pDS, bOverFlow ) \
+ if ( nr < hppa::MAX_WORDS_IN_REGS ) \
+ pGPR[nr++] = *reinterpret_cast<sal_uInt8 *>( pSV ); \
+ else \
+ bOverFlow = true; \
+ if (bOverFlow) \
+ *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV );
+
+namespace hppa
+{
+ bool is_complex_struct(const typelib_TypeDescription * type)
+ {
+ const typelib_CompoundTypeDescription * p
+ = reinterpret_cast< const typelib_CompoundTypeDescription * >(type);
+ for (sal_Int32 i = 0; i < p->nMembers; ++i)
+ {
+ if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT ||
+ p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION)
+ {
+ typelib_TypeDescription * t = 0;
+ TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]);
+ bool b = is_complex_struct(t);
+ TYPELIB_DANGER_RELEASE(t);
+ if (b) {
+ return true;
+ }
+ }
+ else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass))
+ return true;
+ }
+ if (p->pBaseTypeDescription != 0)
+ return is_complex_struct(&p->pBaseTypeDescription->aBase);
+ return false;
+ }
+
+ bool isRegisterReturn( typelib_TypeDescriptionReference *pTypeRef )
+ {
+ if (bridges::cpp_uno::shared::isSimpleType(pTypeRef))
+ return true;
+ else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION)
+ {
+ typelib_TypeDescription * pTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef );
+
+ /* If the struct is larger than 8 bytes, then there is a buffer at r8 to stick the return value into */
+ bool bRet = pTypeDescr->nSize <= 8 && !is_complex_struct(pTypeDescr);
+
+ TYPELIB_DANGER_RELEASE( pTypeDescr );
+ return bRet;
+ }
+ return false;
+ }
+}
+
+
+namespace {
+//=======================================================================
+static void cpp_call(
+ bridges::cpp_uno::shared::UnoInterfaceProxy * pThis,
+ bridges::cpp_uno::shared::VtableSlot aVtableSlot,
+ typelib_TypeDescriptionReference * pReturnTypeRef,
+ sal_Int32 nParams, typelib_MethodParameter * pParams,
+ void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc )
+{
+ // max space for: [complex ret ptr], values|ptr ...
+ sal_uInt32 * pStack = (sal_uInt32 *)__builtin_alloca(
+ sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) );
+ sal_uInt32 * pStackStart = pStack;
+
+ sal_uInt32 pGPR[hppa::MAX_GPR_REGS];
+ double pFPR[hppa::MAX_SSE_REGS];
+ sal_uInt32 nRegs=0;
+
+ // return
+ typelib_TypeDescription * pReturnTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
+ OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" );
+
+ void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
+ bool bOverFlow = false;
+ bool bRegisterReturn = true;
+
+ if (pReturnTypeDescr)
+ {
+
+ bRegisterReturn = hppa::isRegisterReturn(pReturnTypeRef);
+ if (bRegisterReturn)
+ pCppReturn = pUnoReturn; // direct way for simple types
+ else
+ {
+ // complex return via ptr
+ pCppReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr )
+ ? __builtin_alloca( pReturnTypeDescr->nSize )
+ : pUnoReturn); // direct way
+ }
+ }
+ // push this
+ void * pAdjustedThisPtr = reinterpret_cast< void ** >(pThis->getCppI())
+ + aVtableSlot.offset;
+ INSERT_INT32( &pAdjustedThisPtr, nRegs, pGPR, pStack, bOverFlow );
+
+ // stack space
+ OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
+ // args
+ void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams );
+ // indizes of values this have to be converted (interface conversion cpp<=>uno)
+ sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams);
+ // type descriptions for reconversions
+ typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams));
+
+ sal_Int32 nTempIndizes = 0;
+
+ for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
+ {
+ const typelib_MethodParameter & rParam = pParams[nPos];
+ typelib_TypeDescription * pParamTypeDescr = 0;
+ TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
+
+ if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
+ {
+ uno_copyAndConvertData( pCppArgs[nPos] = alloca(8), pUnoArgs[nPos],
+ pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
+
+ switch (pParamTypeDescr->eTypeClass)
+ {
+ case typelib_TypeClass_HYPER:
+ case typelib_TypeClass_UNSIGNED_HYPER:
+#ifdef CMC_DEBUG
+ fprintf(stderr, "hyper is %llx\n", *((long long*)pCppArgs[nPos]));
+#endif
+ INSERT_INT64( pCppArgs[nPos], nRegs, pGPR, pStack, pStackStart, bOverFlow );
+ break;
+ case typelib_TypeClass_LONG:
+ case typelib_TypeClass_UNSIGNED_LONG:
+ case typelib_TypeClass_ENUM:
+#ifdef CMC_DEBUG
+ fprintf(stderr, "long is %x\n", pCppArgs[nPos]);
+#endif
+ INSERT_INT32( pCppArgs[nPos], nRegs, pGPR, pStack, bOverFlow );
+ break;
+ case typelib_TypeClass_SHORT:
+ case typelib_TypeClass_CHAR:
+ case typelib_TypeClass_UNSIGNED_SHORT:
+ INSERT_INT16( pCppArgs[nPos], nRegs, pGPR, pStack, bOverFlow );
+ break;
+ case typelib_TypeClass_BOOLEAN:
+ case typelib_TypeClass_BYTE:
+ INSERT_INT8( pCppArgs[nPos], nRegs, pGPR, pStack, bOverFlow );
+ break;
+ case typelib_TypeClass_FLOAT:
+ INSERT_FLOAT( pCppArgs[nPos], nRegs, pFPR, pStack, bOverFlow );
+ break;
+ case typelib_TypeClass_DOUBLE:
+ INSERT_DOUBLE( pCppArgs[nPos], nRegs, pFPR, pStack, pStackStart, bOverFlow );
+ break;
+ default:
+ break;
+ }
+ // no longer needed
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ else // ptr to complex value | ref
+ {
+ if (! rParam.bIn) // is pure out
+ {
+ // cpp out is constructed mem, uno out is not!
+ uno_constructData(
+ pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
+ pParamTypeDescr );
+ pTempIndizes[nTempIndizes] = nPos; // default constructed for cpp call
+ // will be released at reconversion
+ ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+ }
+ // is in/inout
+ else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr ))
+ {
+ uno_copyAndConvertData(
+ pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
+ pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
+
+ pTempIndizes[nTempIndizes] = nPos; // has to be reconverted
+ // will be released at reconversion
+ ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+ }
+ else // direct way
+ {
+ pCppArgs[nPos] = pUnoArgs[nPos];
+ // no longer needed
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ INSERT_INT32( &(pCppArgs[nPos]), nRegs, pGPR, pStack, bOverFlow );
+ }
+ }
+
+ try
+ {
+ callVirtualMethod(
+ pAdjustedThisPtr, aVtableSlot.index,
+ pCppReturn, pReturnTypeDescr, bRegisterReturn,
+ pStackStart,
+ (pStack - pStackStart), pGPR, pFPR);
+
+ // NO exception occured...
+ *ppUnoExc = 0;
+
+ // reconvert temporary params
+ for ( ; nTempIndizes--; )
+ {
+ sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+ typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes];
+
+ if (pParams[nIndex].bIn)
+ {
+ if (pParams[nIndex].bOut) // inout
+ {
+ uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value
+ uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
+ pThis->getBridge()->getCpp2Uno() );
+ }
+ }
+ else // pure out
+ {
+ uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
+ pThis->getBridge()->getCpp2Uno() );
+ }
+ // destroy temp cpp param => cpp: every param was constructed
+ uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release );
+
+ TYPELIB_DANGER_RELEASE( pParamTypeDescr );
+ }
+ // return value
+ if (pCppReturn && pUnoReturn != pCppReturn)
+ {
+ uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr,
+ pThis->getBridge()->getCpp2Uno() );
+ uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release );
+ }
+ }
+ catch (...)
+ {
+ // fill uno exception
+ fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() );
+
+ // temporary params
+ for ( ; nTempIndizes--; )
+ {
+ sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+ // destroy temp cpp param => cpp: every param was constructed
+ uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], cpp_release );
+ TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] );
+ }
+
+ // return type
+ if (pReturnTypeDescr)
+ TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
+ }
+}
+}
+
+namespace bridges { namespace cpp_uno { namespace shared {
+
+void unoInterfaceProxyDispatch(
+ uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr,
+ void * pReturn, void * pArgs[], uno_Any ** ppException )
+{
+ // is my surrogate
+ bridges::cpp_uno::shared::UnoInterfaceProxy * pThis
+ = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI);
+#if OSL_DEBUG_LEVEL > 0
+ typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr;
+#endif
+
+ switch (pMemberDescr->eTypeClass)
+ {
+ case typelib_TypeClass_INTERFACE_ATTRIBUTE:
+ {
+#if OSL_DEBUG_LEVEL > 0
+ // determine vtable call index
+ sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition;
+ OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" );
+#endif
+
+ VtableSlot aVtableSlot(
+ getVtableSlot(
+ reinterpret_cast<typelib_InterfaceAttributeTypeDescription const *>
+ (pMemberDescr)));
+
+ if (pReturn)
+ {
+ // dependent dispatch
+ cpp_call(
+ pThis, aVtableSlot,
+ ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef,
+ 0, 0, // no params
+ pReturn, pArgs, ppException );
+ }
+ else
+ {
+ // is SET
+ typelib_MethodParameter aParam;
+ aParam.pTypeRef =
+ ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef;
+ aParam.bIn = sal_True;
+ aParam.bOut = sal_False;
+
+ typelib_TypeDescriptionReference * pReturnTypeRef = 0;
+ OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") );
+ typelib_typedescriptionreference_new(
+ &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData );
+
+ // dependent dispatch
+ aVtableSlot.index += 1;
+ cpp_call(
+ pThis, aVtableSlot, // get, then set method
+ pReturnTypeRef,
+ 1, &aParam,
+ pReturn, pArgs, ppException );
+
+ typelib_typedescriptionreference_release( pReturnTypeRef );
+ }
+
+ break;
+ }
+ case typelib_TypeClass_INTERFACE_METHOD:
+ {
+#if OSL_DEBUG_LEVEL > 0
+ // determine vtable call index
+ sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition;
+ OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" );
+#endif
+
+ VtableSlot aVtableSlot(
+ getVtableSlot(
+ reinterpret_cast<typelib_InterfaceMethodTypeDescription const *>
+ (pMemberDescr)));
+
+ switch (aVtableSlot.index)
+ {
+ // standard calls
+ case 1: // acquire uno interface
+ (*pUnoI->acquire)( pUnoI );
+ *ppException = 0;
+ break;
+ case 2: // release uno interface
+ (*pUnoI->release)( pUnoI );
+ *ppException = 0;
+ break;
+ case 0: // queryInterface() opt
+ {
+ typelib_TypeDescription * pTD = 0;
+ TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() );
+ if (pTD)
+ {
+ uno_Interface * pInterface = 0;
+ (*pThis->getBridge()->getUnoEnv()->getRegisteredInterface)(
+ pThis->getBridge()->getUnoEnv(),
+ (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD );
+
+ if (pInterface)
+ {
+ ::uno_any_construct(
+ reinterpret_cast< uno_Any * >( pReturn ),
+ &pInterface, pTD, 0 );
+ (*pInterface->release)( pInterface );
+ TYPELIB_DANGER_RELEASE( pTD );
+ *ppException = 0;
+ break;
+ }
+
+ TYPELIB_DANGER_RELEASE( pTD );
+ }
+ } // else perform queryInterface()
+ default:
+ // dependent dispatch
+ cpp_call(
+ pThis, aVtableSlot,
+ ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef,
+ ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams,
+ ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams,
+ pReturn, pArgs, ppException );
+ }
+ break;
+ }
+ default:
+ {
+ ::com::sun::star::uno::RuntimeException aExc(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ),
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() );
+
+ Type const & rExcType = ::getCppuType( &aExc );
+ // binary identical null reference
+ ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 );
+ }
+ }
+}
+
+} } }
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx
index 35b16d882632..d1d98f222738 100644
--- a/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx
@@ -91,6 +91,31 @@ void MapReturn(const ia64::RegReturn &rRet, double dret, typelib_TypeDescription
namespace ia64
{
+ bool is_complex_struct(const typelib_TypeDescription * type)
+ {
+ const typelib_CompoundTypeDescription * p
+ = reinterpret_cast< const typelib_CompoundTypeDescription * >(type);
+ for (sal_Int32 i = 0; i < p->nMembers; ++i)
+ {
+ if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT ||
+ p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION)
+ {
+ typelib_TypeDescription * t = 0;
+ TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]);
+ bool b = is_complex_struct(t);
+ TYPELIB_DANGER_RELEASE(t);
+ if (b) {
+ return true;
+ }
+ }
+ else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass))
+ return true;
+ }
+ if (p->pBaseTypeDescription != 0)
+ return is_complex_struct(&p->pBaseTypeDescription->aBase);
+ return false;
+ }
+
bool is_complex_struct( typelib_TypeDescriptionReference *pTypeRef )
{
if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION)
@@ -98,7 +123,7 @@ namespace ia64
typelib_TypeDescription * pTypeDescr = 0;
TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef );
- bool bRet = bridges::cpp_uno::shared::relatesToInterfaceType( pTypeDescr );
+ bool bRet = is_complex_struct( pTypeDescr );
TYPELIB_DANGER_RELEASE( pTypeDescr );
return bRet;
diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx
index 0581b52f0c8d..1d63ebde491f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx
@@ -256,7 +256,7 @@ namespace
// destroy temp uno return
uno_destructData( pUnoReturn, pReturnTypeDescr, 0 );
}
- // complex return ptr is set to eax
+ // complex return ptr is set to return reg
*(void **)pRegisterReturn = pCppReturn;
}
if (pReturnTypeDescr)
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
index 2aeaf9423859..ad0faa1a01aa 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
@@ -229,6 +229,7 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c
for ( sal_Int32 nMember = 0; nMember < pStruct->nMembers; ++nMember )
{
typelib_TypeDescriptionReference *pTypeInStruct = pStruct->ppTypeRefs[ nMember ];
+ rByteOffset = pStruct->pMemberOffsets[ nMember ];
int num = classify_argument( pTypeInStruct, subclasses, rByteOffset );
@@ -243,9 +244,6 @@ classify_argument( typelib_TypeDescriptionReference *pTypeRef, enum x86_64_reg_c
int pos = rByteOffset / 8;
classes[i + pos] = merge_classes( subclasses[i], classes[i + pos] );
}
-
- if ( pTypeInStruct->eTypeClass != typelib_TypeClass_STRUCT )
- rByteOffset = pStruct->pMemberOffsets[ nMember ];
}
TYPELIB_DANGER_RELEASE( pTypeDescr );
@@ -332,7 +330,7 @@ bool x86_64::return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef
return examine_argument( pTypeRef, true, g, s ) == 0;
}
-void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, void * const *pGPR, void * const *pSSE, void *pStruct )
+void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, const sal_uInt64 *pGPR, const double *pSSE, void *pStruct )
{
enum x86_64_reg_class classes[MAX_CLASSES];
int offset = 0;
@@ -346,12 +344,12 @@ void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, void * con
{
case X86_64_INTEGER_CLASS:
case X86_64_INTEGERSI_CLASS:
- *pStructAlign++ = *reinterpret_cast<sal_uInt64 *>( *pGPR++ );
+ *pStructAlign++ = *pGPR++;
break;
case X86_64_SSE_CLASS:
case X86_64_SSESF_CLASS:
case X86_64_SSEDF_CLASS:
- *pStructAlign++ = *reinterpret_cast<sal_uInt64 *>( *pSSE++ );
+ *pStructAlign++ = *reinterpret_cast<const sal_uInt64 *>( pSSE++ );
break;
default:
break;
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
index 5fffe680c28a..c5b7d94d2e01 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx
@@ -63,7 +63,7 @@ bool examine_argument( typelib_TypeDescriptionReference *pTypeRef, bool bInRetur
*/
bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef );
-void fill_struct( typelib_TypeDescriptionReference *pTypeRef, void * const *pGPR, void * const *pSSE, void *pStruct );
+void fill_struct( typelib_TypeDescriptionReference *pTypeRef, const sal_uInt64* pGPR, const double* pSSE, void *pStruct );
} // namespace x86_64
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
index 736230705d5a..a0572ef61641 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/call.s
@@ -43,6 +43,9 @@ privateSnippetExecutor:
je .Lfloat
movq -144(%rbp), %rax # Return value (int case)
+ movq -136(%rbp), %rdx # Return value (int case)
+ movq -144(%rbp), %xmm0 # Return value (int case)
+ movq -136(%rbp), %xmm1 # Return value (int case)
jmp .Lfinish
.Lfloat:
movlpd -144(%rbp), %xmm0 # Return value (float/double case)
diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
index 5fb2bd7e12a3..c1e938446e77 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx
@@ -126,7 +126,10 @@ static typelib_TypeClass cpp2uno_call(
int nUsedGPR = 0;
int nUsedSSE = 0;
- bool bFitsRegisters = x86_64::examine_argument( rParam.pTypeRef, false, nUsedGPR, nUsedSSE );
+#if OSL_DEBUG_LEVEL > 1
+ bool bFitsRegisters =
+#endif
+ x86_64::examine_argument( rParam.pTypeRef, false, nUsedGPR, nUsedSSE );
if ( !rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ) ) // value
{
// Simple types must fit exactly one register on x86_64
@@ -159,28 +162,7 @@ static typelib_TypeClass cpp2uno_call(
else // struct <= 16 bytes || ptr to complex value || ref
{
void *pCppStack;
- char pTmpStruct[16];
-
- if ( bFitsRegisters && !rParam.bOut &&
- ( pParamTypeDescr->eTypeClass == typelib_TypeClass_STRUCT ||
- pParamTypeDescr->eTypeClass == typelib_TypeClass_EXCEPTION ) )
- {
- if ( ( nr_gpr + nUsedGPR <= x86_64::MAX_GPR_REGS ) && ( nr_fpr + nUsedSSE <= x86_64::MAX_SSE_REGS ) )
- {
- x86_64::fill_struct( rParam.pTypeRef, gpreg, fpreg, pTmpStruct );
-#if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "nUsedGPR == %d, nUsedSSE == %d, pTmpStruct[0] == 0x%x, pTmpStruct[1] == 0x%x, **gpreg == 0x%lx\n",
- nUsedGPR, nUsedSSE, pTmpStruct[0], pTmpStruct[1], *(sal_uInt64*)*gpreg );
-#endif
-
- pCppArgs[nPos] = pCppStack = reinterpret_cast<void *>( pTmpStruct );
- gpreg += nUsedGPR;
- fpreg += nUsedSSE;
- }
- else
- pCppArgs[nPos] = pCppStack = *ovrflw++;
- }
- else if ( nr_gpr < x86_64::MAX_GPR_REGS )
+ if ( nr_gpr < x86_64::MAX_GPR_REGS )
{
pCppArgs[nPos] = pCppStack = *gpreg++;
nr_gpr++;
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 7199794409a8..23c40121afb7 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx
@@ -53,13 +53,13 @@ using namespace ::com::sun::star::uno;
//==================================================================================================
static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
- void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, bool bSimpleReturn,
+ void * pRegisterReturn, typelib_TypeDescriptionReference * pReturnTypeRef, bool bSimpleReturn,
sal_uInt64 *pStack, sal_uInt32 nStack,
sal_uInt64 *pGPR, sal_uInt32 nGPR,
double *pFPR, sal_uInt32 nFPR) __attribute__((noinline));
static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
- void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, bool bSimpleReturn,
+ void * pRegisterReturn, typelib_TypeDescriptionReference * pReturnTypeRef, bool bSimpleReturn,
sal_uInt64 *pStack, sal_uInt32 nStack,
sal_uInt64 *pGPR, sal_uInt32 nGPR,
double *pFPR, sal_uInt32 nFPR)
@@ -113,6 +113,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
sal_uInt64 rax;
sal_uInt64 rdx;
double xmm0;
+ double xmm1;
asm volatile (
@@ -147,13 +148,14 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
"movq %%rax, %4\n\t"
"movq %%rdx, %5\n\t"
"movsd %%xmm0, %6\n\t"
+ "movsd %%xmm1, %7\n\t"
:
: "m" ( pMethod ), "m" ( pGPR ), "m" ( pFPR ), "m" ( nFPR ),
- "m" ( rax ), "m" ( rdx ), "m" ( xmm0 )
+ "m" ( rax ), "m" ( rdx ), "m" ( xmm0 ), "m" ( xmm1 )
: "rax", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "r11"
);
- switch (pReturnTypeDescr->eTypeClass)
+ switch (pReturnTypeRef->eTypeClass)
{
case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER:
@@ -179,12 +181,17 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
break;
default:
{
- sal_Int32 const nRetSize = pReturnTypeDescr->nSize;
+ sal_Int32 const nRetSize = pReturnTypeRef->pType->nSize;
if (bSimpleReturn && nRetSize <= 16 && nRetSize > 0)
{
- if (nRetSize > 8)
- static_cast<sal_uInt64 *>(pRegisterReturn)[1] = rdx;
- static_cast<sal_uInt64 *>(pRegisterReturn)[0] = rax;
+ sal_uInt64 longs[2];
+ longs[0] = rax;
+ longs[1] = rdx;
+
+ double doubles[2];
+ doubles[0] = xmm0;
+ doubles[1] = xmm1;
+ x86_64::fill_struct( pReturnTypeRef, &longs[0], &doubles[0], pRegisterReturn);
}
break;
}
@@ -367,7 +374,7 @@ static void cpp_call(
{
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
- pCppReturn, pReturnTypeDescr, bSimpleReturn,
+ pCppReturn, pReturnTypeRef, bSimpleReturn,
pStackStart, ( pStack - pStackStart ),
pGPR, nGPR,
pFPR, nFPR );
diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx
index 34e5f9635974..3784f3959594 100644
--- a/bridges/source/cpp_uno/shared/vtablefactory.cxx
+++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx
@@ -272,7 +272,7 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
char *tmpfname = new char[aTmpName.getLength()+1];
strncpy(tmpfname, aTmpName.getStr(), aTmpName.getLength()+1);
if ((block.fd = mkstemp(tmpfname)) == -1)
- perror("creation of executable memory area failed");
+ perror("creation of executable memory area failed");
if (block.fd == -1)
{
delete[] tmpfname;
@@ -280,7 +280,13 @@ bool VtableFactory::createBlock(Block &block, sal_Int32 slotCount) const
}
unlink(tmpfname);
delete[] tmpfname;
- ftruncate(block.fd, block.size);
+ if (ftruncate(block.fd, block.size) == -1)
+ {
+ perror("truncation of executable memory area failed");
+ close(block.fd);
+ block.fd = -1;
+ break;
+ }
block.start = mmap(NULL, block.size, PROT_READ | PROT_WRITE, MAP_SHARED, block.fd, 0);
if (block.start== MAP_FAILED) {
block.start = 0;
diff --git a/cppuhelper/inc/cppuhelper/weak.hxx b/cppuhelper/inc/cppuhelper/weak.hxx
index f4b9c38d2215..9072ba6f6240 100644
--- a/cppuhelper/inc/cppuhelper/weak.hxx
+++ b/cppuhelper/inc/cppuhelper/weak.hxx
@@ -67,6 +67,12 @@ protected:
*/
virtual ~OWeakObject() SAL_THROW( (::com::sun::star::uno::RuntimeException) );
+ /** disposes and resets m_pWeakConnectionPoint
+ @precond
+ m_refCount equals 0
+ */
+ void disposeWeakConnectionPoint();
+
/** reference count.
@attention
diff --git a/cppuhelper/source/cc5_solaris_sparc.map b/cppuhelper/source/cc5_solaris_sparc.map
index 0c3f1c556d64..0961c6830d1f 100755
--- a/cppuhelper/source/cc5_solaris_sparc.map
+++ b/cppuhelper/source/cc5_solaris_sparc.map
@@ -379,3 +379,8 @@ UDK_3.6 { # OOo 3.0
__1cEcppuSOPropertySetHelper2t5B6Mrn0ATOBroadcastHelperVar4n0AbIOMultiTypeInterfaceContainerHelper_nDcomDsunEstarDunoEType___pn0AWIEventNotificationHook_b_v_;
__1cEcppuSOPropertySetHelper2t6Mrn0ATOBroadcastHelperVar4n0AbIOMultiTypeInterfaceContainerHelper_nDcomDsunEstarDunoEType___pn0AWIEventNotificationHook_b_v_;
} UDK_3.5;
+
+UDK_3.7 { # OOo 3.3
+ global:
+ __1cEcppuLOWeakObjectbAdisposeWeakConnectionPoint6M_v_;
+} UDK_3.6;
diff --git a/cppuhelper/source/component.cxx b/cppuhelper/source/component.cxx
index d94614703be5..728f6815c309 100644
--- a/cppuhelper/source/component.cxx
+++ b/cppuhelper/source/component.cxx
@@ -90,6 +90,10 @@ void OComponentHelper::release() throw()
{
if (! rBHelper.bDisposed)
{
+ // *before* again incrementing our ref count, ensure that our weak connection point
+ // will not create references to us anymore (via XAdapter::queryAdapted)
+ disposeWeakConnectionPoint();
+
Reference<XInterface > xHoldAlive( *this );
// First dispose
try
diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map
index 819c3e046b30..9348e91525c0 100644
--- a/cppuhelper/source/gcc3.map
+++ b/cppuhelper/source/gcc3.map
@@ -373,3 +373,9 @@ UDK_3.5 { # OOo 3.0
_ZN4cppu18OPropertySetHelperC1ERNS_19OBroadcastHelperVarINS_34OMultiTypeInterfaceContainerHelperEN3com3sun4star3uno4TypeEEEPNS_22IEventNotificationHookEb;
_ZN4cppu18OPropertySetHelperC2ERNS_19OBroadcastHelperVarINS_34OMultiTypeInterfaceContainerHelperEN3com3sun4star3uno4TypeEEEPNS_22IEventNotificationHookEb;
} UDK_3.4;
+
+UDK_3.6 { # OOo 3.3
+ global:
+ _ZN4cppu11OWeakObject26disposeWeakConnectionPointEv;
+} UDK_3.5;
+
diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx
index 9caa4ca93615..acf05724c71b 100644
--- a/cppuhelper/source/implbase.cxx
+++ b/cppuhelper/source/implbase.cxx
@@ -247,6 +247,8 @@ void WeakComponentImplHelperBase::release()
throw ()
{
if (osl_decrementInterlockedCount( &m_refCount ) == 0) {
+ // ensure no other references are created, via the weak connection point, from now on
+ disposeWeakConnectionPoint();
// restore reference count:
osl_incrementInterlockedCount( &m_refCount );
if (! rBHelper.bDisposed) {
@@ -381,6 +383,8 @@ void WeakAggComponentImplHelperBase::release()
OWeakAggObject::release();
}
else if (osl_decrementInterlockedCount( &m_refCount ) == 0) {
+ // ensure no other references are created, via the weak connection point, from now on
+ disposeWeakConnectionPoint();
// restore reference count:
osl_incrementInterlockedCount( &m_refCount );
if (! rBHelper.bDisposed) {
diff --git a/cppuhelper/source/msvc_win32_intel.map b/cppuhelper/source/msvc_win32_intel.map
index a90ec88f3ca3..c999ae200ac2 100644
--- a/cppuhelper/source/msvc_win32_intel.map
+++ b/cppuhelper/source/msvc_win32_intel.map
@@ -271,3 +271,8 @@ UDK_3.5 { # OOo 3.0
global:
??0OPropertySetHelper@cppu@@QAE@AAU?$OBroadcastHelperVar@VOMultiTypeInterfaceContainerHelper@cppu@@VType@uno@star@sun@com@@@1@PAVIEventNotificationHook@1@_N@Z;
} UDK_3.4;
+
+UDK_3.6 { # OOo 3.3
+ global:
+ ?disposeWeakConnectionPoint@OWeakObject@cppu@@IAEXXZ;
+} UDK_3.5;
diff --git a/cppuhelper/source/tdmgr.cxx b/cppuhelper/source/tdmgr.cxx
index 306ace09d592..6f2aa70ea2d5 100644
--- a/cppuhelper/source/tdmgr.cxx
+++ b/cppuhelper/source/tdmgr.cxx
@@ -688,17 +688,17 @@ static void SAL_CALL typelib_callback(
catch (container::NoSuchElementException & exc)
{
(void) exc; // avoid warning about unused variable
- OSL_ENSURE(
- 0, OUStringToOString(
- OUString( RTL_CONSTASCII_USTRINGPARAM(
- "typelibrary type not available: ") ) +
+ OSL_TRACE(
+ "typelibrary type not available: %s",
+ OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
}
catch (Exception & exc)
{
(void) exc; // avoid warning about unused variable
- OSL_ENSURE(
- 0, OUStringToOString(
+ OSL_TRACE(
+ "%s",
+ OUStringToOString(
exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
}
}
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index c4055eba4f8a..b518d2526e3b 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -216,25 +216,31 @@ void SAL_CALL OWeakObject::release() throw()
if (osl_decrementInterlockedCount( &m_refCount ) == 0) {
// notify/clear all weak-refs before object's dtor is executed
// (which may check weak-refs to this object):
- if (m_pWeakConnectionPoint != 0) {
- OWeakConnectionPoint * const p = m_pWeakConnectionPoint;
- m_pWeakConnectionPoint = 0;
- try {
- p->dispose();
- }
- catch (RuntimeException const& exc) {
- OSL_ENSURE(
- false, OUStringToOString(
- exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
- static_cast<void>(exc);
- }
- p->release();
- }
+ disposeWeakConnectionPoint();
// destroy object:
delete this;
}
}
+void OWeakObject::disposeWeakConnectionPoint()
+{
+ OSL_PRECOND( m_refCount == 0, "OWeakObject::disposeWeakConnectionPoint: only to be called with a ref count of 0!" );
+ if (m_pWeakConnectionPoint != 0) {
+ OWeakConnectionPoint * const p = m_pWeakConnectionPoint;
+ m_pWeakConnectionPoint = 0;
+ try {
+ p->dispose();
+ }
+ catch (RuntimeException const& exc) {
+ OSL_ENSURE(
+ false, OUStringToOString(
+ exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
+ static_cast<void>(exc);
+ }
+ p->release();
+ }
+}
+
OWeakObject::~OWeakObject() SAL_THROW( (RuntimeException) )
{
}
diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx
index e55dc961903b..11bc0fe4d657 100644
--- a/idlc/inc/idlc/options.hxx
+++ b/idlc/inc/idlc/options.hxx
@@ -69,11 +69,15 @@ public:
const StringVector& getInputFiles() const { return m_inputFiles; }
bool readStdin() const { return m_stdin; }
+ bool verbose() const { return m_verbose; }
+ bool quiet() const { return m_quiet; }
protected:
::rtl::OString m_program;
StringVector m_inputFiles;
bool m_stdin;
+ bool m_verbose;
+ bool m_quiet;
OptionMap m_options;
};
diff --git a/idlc/source/idlcmain.cxx b/idlc/source/idlcmain.cxx
index 1ce3a9fa05b0..68c1ae7cf5a5 100644
--- a/idlc/source/idlcmain.cxx
+++ b/idlc/source/idlcmain.cxx
@@ -56,11 +56,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
sal_Int32 nErrors = 0;
if (options.readStdin()) {
- fprintf(
- stdout, "%s: compile stdin...\n",
- options.getProgramName().getStr());
+ if ( !options.quiet() )
+ fprintf(
+ stdout, "%s: Compiling stdin\n",
+ options.getProgramName().getStr());
nErrors = compileFile(0);
- if (idlc()->getWarningCount() > 0) {
+ if ( ( idlc()->getWarningCount() > 0 ) && !options.quiet() ) {
fprintf(
stdout, "%s: detected %lu warnings compiling stdin\n",
options.getProgramName().getStr(),
@@ -85,16 +86,23 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
idlc()->reset();
}
StringVector const & files = options.getInputFiles();
+ if ( options.verbose() )
+ {
+ fprintf( stdout, "%s: compiling %i source files ... \n",
+ options.getProgramName().getStr(), (int)files.size() );
+ fflush( stdout );
+ }
for (StringVector::const_iterator i(files.begin());
i != files.end() && nErrors == 0; ++i)
{
OString sysFileName( convertToAbsoluteSystemPath(*i) );
- fprintf(stdout, "%s: compile '%s' ... \n",
- options.getProgramName().getStr(), (*i).getStr());
+ if ( !options.quiet() )
+ fprintf(stdout, "Compiling: %s\n",
+ (*i).getStr());
nErrors = compileFile(&sysFileName);
- if ( idlc()->getWarningCount() )
+ if ( idlc()->getWarningCount() && !options.quiet() )
fprintf(stdout, "%s: detected %lu warnings compiling file '%s'\n",
options.getProgramName().getStr(),
sal::static_int_cast< unsigned long >(
@@ -128,15 +136,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if ( nErrors > 0 )
{
- fprintf(stdout, "%s: detected %ld errors%s",
+ fprintf(stderr, "%s: detected %ld errors%s",
options.getProgramName().getStr(),
sal::static_int_cast< long >(nErrors),
options.prepareVersion().getStr());
} else
{
- fprintf(stdout, "%s: returned successful%s",
- options.getProgramName().getStr(),
- options.prepareVersion().getStr());
+ if ( options.verbose() )
+ fprintf(stdout, "%s: returned successful%s",
+ options.getProgramName().getStr(),
+ options.prepareVersion().getStr());
}
return nErrors;
}
diff --git a/idlc/source/options.cxx b/idlc/source/options.cxx
index 6bfbcc9e443e..963ddafda8d0 100644
--- a/idlc/source/options.cxx
+++ b/idlc/source/options.cxx
@@ -37,7 +37,7 @@
using namespace rtl;
-Options::Options(): m_stdin(false)
+Options::Options(): m_stdin(false), m_verbose(false), m_quiet(false)
{
}
@@ -190,6 +190,22 @@ sal_Bool Options::initOptions(int ac, char* av[], sal_Bool bCmdFile)
} else
throw IllegalArgument(OString(av[j]) + ", please check your input");
break;
+ case 'v':
+ if ( 0 == strcmp( &av[j][1], "verbose" ) )
+ {
+ m_verbose = true;
+ }
+ else
+ throw IllegalArgument(OString(av[j]) + ", please check your input");
+ break;
+ case 'q':
+ if ( 0 == strcmp( &av[j][1], "quiet" ) )
+ {
+ m_quiet = true;
+ }
+ else
+ throw IllegalArgument(OString(av[j]) + ", please check your input");
+ break;
case 'w':
if (av[j][2] == 'e' && av[j][3] == '\0') {
if (m_options.count("-we") == 0)
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
index 680a1be74f41..b1be7cefc1a9 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx
@@ -70,9 +70,11 @@ namespace jfw_plugin
#define JFW_PLUGIN_ARCH "ia64"
#elif defined M68K
#define JFW_PLUGIN_ARCH "m68k"
-#else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K
+#elif defined HPPA
+#define JFW_PLUGIN_ARCH "parisc"
+#else // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA
#error unknown plattform
-#endif // SPARC, INTEL, POWERPC, MIPS, ARM
+#endif // SPARC, INTEL, POWERPC, MIPS, ARM, IA64, M68K, HPPA
class MalformedVersionException
diff --git a/offapi/com/sun/star/awt/XTopWindow2.idl b/offapi/com/sun/star/awt/XTopWindow2.idl
new file mode 100644
index 000000000000..0cc289d42b17
--- /dev/null
+++ b/offapi/com/sun/star/awt/XTopWindow2.idl
@@ -0,0 +1,76 @@
+/*************************************************************************
+* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+*
+* Copyright 2009 by Sun Microsystems, Inc.
+*
+* OpenOffice.org - a multi-platform office productivity suite
+*
+* This file is part of OpenOffice.org.
+*
+* OpenOffice.org is free software: you can redistribute it and/or modify
+* it under the terms of the GNU Lesser General Public License version 3
+* only, as published by the Free Software Foundation.
+*
+* OpenOffice.org is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU Lesser General Public License version 3 for more details
+* (a copy is included in the LICENSE file that accompanied this code).
+*
+* You should have received a copy of the GNU Lesser General Public License
+* version 3 along with OpenOffice.org. If not, see
+* <http://www.openoffice.org/license.html>
+* for a copy of the LGPLv3 License.
+************************************************************************/
+
+#ifndef __com_sun_star_awt_XTopWindow2_idl__
+#define __com_sun_star_awt_XTopWindow2_idl__
+
+#include <com/sun/star/awt/XTopWindow.idl>
+#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
+
+//=============================================================================
+
+module com { module sun { module star { module awt {
+
+//=============================================================================
+
+/** extends XTopWindow with additional functionality
+ */
+interface XTopWindow2 : XTopWindow
+{
+ /** controls whether the window is currently maximized
+ */
+ [attribute] boolean IsMaximized;
+
+ /** controls whether the window is currently minimized
+ */
+ [attribute] boolean IsMinimized;
+
+ /** controls on which display the window is shown.
+
+ <p>When retrieving this property, in case the window is positioned on multiple displays,
+ the number returned will be of the display containing the upper left pixel of the frame
+ area (that is of the client area on system decorated windows, or the frame area of
+ undecorated resp. owner decorated windows).</p>
+
+ @throws ::com::sun::star::lang::IndexOutOfBoundsException
+ if you attempt to set this property to a value which does not correspond to the number
+ of an existing screen.
+
+ @see com::sun::star::awt::DisplayAccess
+ @see com::sun::star::awt::DisplayInfo
+ */
+ [attribute] long Display
+ {
+ set raises (::com::sun::star::lang::IndexOutOfBoundsException);
+ };
+};
+
+//=============================================================================
+
+}; }; }; };
+
+//=============================================================================
+
+#endif
diff --git a/offapi/com/sun/star/awt/makefile.mk b/offapi/com/sun/star/awt/makefile.mk
index c0c501cbe2c5..dd2e9857124c 100644
--- a/offapi/com/sun/star/awt/makefile.mk
+++ b/offapi/com/sun/star/awt/makefile.mk
@@ -305,6 +305,7 @@ IDLFILES=\
XToggleButton.idl\
XToolkit.idl\
XTopWindow.idl\
+ XTopWindow2.idl\
XTopWindowListener.idl\
XUnitConversion.idl\
XUnoControlContainer.idl\
diff --git a/offapi/com/sun/star/document/DocumentEvent.idl b/offapi/com/sun/star/document/DocumentEvent.idl
index 1391f9becaf5..0b5b2cd5a205 100644
--- a/offapi/com/sun/star/document/DocumentEvent.idl
+++ b/offapi/com/sun/star/document/DocumentEvent.idl
@@ -52,6 +52,7 @@ module com { module sun { module star { module document {
anymore.</p>
@see XDocumentEventBroadcaster
+ @since OpenOffice.org 3.1
*/
struct DocumentEvent : ::com::sun::star::lang::EventObject
{
diff --git a/offapi/com/sun/star/document/XDocumentEventBroadcaster.idl b/offapi/com/sun/star/document/XDocumentEventBroadcaster.idl
index 596adf722ea8..5780d3f92bbf 100644
--- a/offapi/com/sun/star/document/XDocumentEventBroadcaster.idl
+++ b/offapi/com/sun/star/document/XDocumentEventBroadcaster.idl
@@ -61,6 +61,7 @@ interface XDocumentEventListener;
anymore.</p>
@see DocumentEvent
+ @since OpenOffice.org 3.1
*/
interface XDocumentEventBroadcaster
{
diff --git a/offapi/com/sun/star/document/XDocumentEventListener.idl b/offapi/com/sun/star/document/XDocumentEventListener.idl
index 345e320cecae..b98d81a73251 100644
--- a/offapi/com/sun/star/document/XDocumentEventListener.idl
+++ b/offapi/com/sun/star/document/XDocumentEventListener.idl
@@ -50,6 +50,7 @@ module com { module sun { module star { module document {
anymore.</p>
@see XDocumentEventBroadcaster
+ @since OpenOffice.org 3.1
*/
interface XDocumentEventListener : ::com::sun::star::lang::XEventListener
{
diff --git a/offapi/com/sun/star/modules.idl b/offapi/com/sun/star/modules.idl
index d91c8edad1ff..81bcb46f06a0 100644
--- a/offapi/com/sun/star/modules.idl
+++ b/offapi/com/sun/star/modules.idl
@@ -78,9 +78,6 @@ module chart {};
*/
module chart2 {};
-/// Non-JDBC conform database interfaces <b>(deprecated)</d>
-module data {};
-
/// Access to the tree of configuration data.
module configuration {};
diff --git a/offapi/com/sun/star/presentation/XSlideShow.idl b/offapi/com/sun/star/presentation/XSlideShow.idl
index 3d7f928249c9..88bbef3b16fb 100644
--- a/offapi/com/sun/star/presentation/XSlideShow.idl
+++ b/offapi/com/sun/star/presentation/XSlideShow.idl
@@ -93,6 +93,25 @@ interface XSlideShow : ::com::sun::star::uno::XInterface
*/
boolean nextEffect();
+ /** Undo the last effect in the main sequence of the slideshow.<p>
+
+ The current slide is displayed as if the last user-triggered effect
+ has never been triggered. If there is no previous effect on the
+ current slide then slideEnded(true) is called at the registered
+ XSlideShowListener objects, which can then trigger a change to the
+ previous slide. Note that this command is executed asynchronously.
+ Multiple calls to update() may be necessary to complete its execution.
+ If there is currently no slideshow running, this method does
+ nothing.<p>
+
+ @return <TRUE/>, if the previous effect was successfully
+ triggered. This method returns <FALSE/>, if there is no show
+ running, the first effect on the first slide was not yet
+ triggered, or the implementation failed to trigger the previous
+ effect.
+ */
+ boolean previousEffect();
+
/** Start a shape-intrinsic animation or activity.<p>
This method starts an animation or activity intrinsic to the
@@ -145,8 +164,24 @@ interface XSlideShow : ::com::sun::star::uno::XInterface
a different slide, this will still work but will not have any performance
improvements
</li>
+ <li>name: SkipAllMainSequenceEffects, value: boolean.
+ When <TRUE/> then all main sequence effects on the new slide
+ are triggered. This is typically used when going back one
+ effect leads to the previous slide. On that slide all
+ effects have to be shown in order to continue the backward
+ travelling.
+ When <FALSE/>, the default, then no main sequence effect is
+ triggered.
+ </li>
+ <li>name: SkipSlideTransition, value: boolean.
+ When <TRUE/> then the slide transition animation, if there
+ is any, is not displayed. This is typically used when going
+ back one effect leads to the previous slide. Typically used
+ together with SkipAllMainSequenceEffects also being <TRUE/>.
+ When <FALSE/>, the default, then the slide transition
+ effect, if it exists, is played.
+ </li>
</ul>
-
*/
void displaySlide(
[in] ::com::sun::star::drawing::XDrawPage xSlide,
diff --git a/offapi/com/sun/star/presentation/XSlideShowController.idl b/offapi/com/sun/star/presentation/XSlideShowController.idl
index 9476604a2c77..8ddc9931e163 100644
--- a/offapi/com/sun/star/presentation/XSlideShowController.idl
+++ b/offapi/com/sun/star/presentation/XSlideShowController.idl
@@ -121,6 +121,14 @@ interface XSlideShowController
//-------------------------------------------------------------------------
+ /** undo the last effects that where triggered by a generic trigger.
+ <p>If there is no previous effect that can be undone then the
+ previous slide will be displayed.
+ */
+ void gotoPreviousEffect();
+
+ //-------------------------------------------------------------------------
+
/** goto and display first slide */
void gotoFirstSlide();
diff --git a/offapi/com/sun/star/presentation/XSlideShowListener.idl b/offapi/com/sun/star/presentation/XSlideShowListener.idl
index 90b7dec18e84..46786eabc03c 100644
--- a/offapi/com/sun/star/presentation/XSlideShowListener.idl
+++ b/offapi/com/sun/star/presentation/XSlideShowListener.idl
@@ -65,8 +65,12 @@ interface XSlideShowListener : ::com::sun::star::animations::XAnimationListener
/** Notify that the current slide has ended,
e.g. the user has clicked on the slide.
Calling displaySlide() twice will not issue this event.
+ @param reverse
+ For the default order (forward) this flag is <FALSE/>.
+ When the main sequence was traversed in reverse order then this
+ flag is <TRUE/>.
*/
- void slideEnded();
+ void slideEnded( [in] boolean reverse );
/** Notifies that a hyperlink has been clicked.
@param hyperLink hyperlink URL
diff --git a/offapi/util/makefile.mk b/offapi/util/makefile.mk
index b0fa7a30cf46..d3157dac31df 100644
--- a/offapi/util/makefile.mk
+++ b/offapi/util/makefile.mk
@@ -164,14 +164,14 @@ ALLTAR : $(UCR)$/types.db \
$(UNOTYPE_STATISTICS)
$(UCR)$/types.db : $(UCR)$/offapi.db $(SOLARBINDIR)$/udkapi.rdb
- -$(RM) $(REGISTRYCHECKFLAG)
- $(GNUCOPY) -f $(UCR)$/offapi.db $@
- $(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi.rdb
+ @-$(RM) $(REGISTRYCHECKFLAG)
+ @$(GNUCOPY) -f $(UCR)$/offapi.db $@
+ $(COMMAND_ECHO)$(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi.rdb
$(OUT)$/ucrdoc$/types_doc.db : $(OUT)$/ucrdoc$/offapi_doc.db $(SOLARBINDIR)$/udkapi_doc.rdb
- -$(RM) $(REGISTRYCHECKFLAG)
- $(GNUCOPY) -f $(OUT)$/ucrdoc$/offapi_doc.db $@
- $(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi_doc.rdb
+ @-$(RM) $(REGISTRYCHECKFLAG)
+ @$(GNUCOPY) -f $(OUT)$/ucrdoc$/offapi_doc.db $@
+ $(COMMAND_ECHO)$(REGMERGE) $@ / $(SOLARBINDIR)$/udkapi_doc.rdb
#JSC: The type library has changed, all temporary not checked types are removed
# and will be check from now on.
diff --git a/offapi/util/target.pmk b/offapi/util/target.pmk
index 08912b011857..63804f3e554a 100644
--- a/offapi/util/target.pmk
+++ b/offapi/util/target.pmk
@@ -30,8 +30,8 @@
#*************************************************************************
$(OUT)$/misc$/$(TARGET).idls: makefile.mk
- -$(RM) $@
- $(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
ALLTAR: $(OUT)$/misc$/$(TARGET).idls
diff --git a/pyuno/source/loader/makefile.mk b/pyuno/source/loader/makefile.mk
index 6e4f96ed7014..f9f00e4f13ae 100644
--- a/pyuno/source/loader/makefile.mk
+++ b/pyuno/source/loader/makefile.mk
@@ -42,7 +42,7 @@ DLLPRE =
#-------------------------------------------------------------------
-.IF "$(OS)$(CPU)$(COMEX)" == "SOLARISS4"
+.IF "$(OS)$(COMEX)" == "SOLARIS4"
# no -Bdirect for SunWS CC
DIRECT = $(LINKFLAGSDEFS)
.ENDIF
diff --git a/pyuno/source/module/makefile.mk b/pyuno/source/module/makefile.mk
index 2357d0062ed0..2928d29668aa 100644
--- a/pyuno/source/module/makefile.mk
+++ b/pyuno/source/module/makefile.mk
@@ -42,7 +42,7 @@ LINKFLAGSDEFS = # do not fail with missing symbols
.IF "$(L10N_framework)"==""
#-------------------------------------------------------------------
-.IF "$(OS)$(CPU)$(COMEX)" == "SOLARISS4"
+.IF "$(OS)$(COMEX)" == "SOLARIS4"
# no -Bdirect for SunWS CC
DIRECT = $(LINKFLAGSDEFS)
.ENDIF
diff --git a/pyuno/source/module/pyuno_gc.cxx b/pyuno/source/module/pyuno_gc.cxx
index 513c14a99378..1e0ca08ff954 100644
--- a/pyuno/source/module/pyuno_gc.cxx
+++ b/pyuno/source/module/pyuno_gc.cxx
@@ -43,6 +43,12 @@ public:
};
StaticDestructorGuard guard;
+static bool isAfterUnloadOrPy_Finalize()
+{
+ return g_destructorsOfStaticObjectsHaveBeenCalled ||
+ !Py_IsInitialized();
+}
+
class GCThread : public ::osl::Thread
{
PyObject *mPyObject;
@@ -64,7 +70,7 @@ GCThread::GCThread( PyInterpreterState *interpreter, PyObject * object ) :
void GCThread::run()
{
// otherwise we crash here, when main has been left already
- if( g_destructorsOfStaticObjectsHaveBeenCalled )
+ if( isAfterUnloadOrPy_Finalize() )
return;
try
{
@@ -100,7 +106,7 @@ void GCThread::onTerminated()
void decreaseRefCount( PyInterpreterState *interpreter, PyObject *object )
{
// otherwise we crash in the last after main ...
- if( g_destructorsOfStaticObjectsHaveBeenCalled )
+ if( isAfterUnloadOrPy_Finalize() )
return;
// delegate to a new thread, because there does not seem
diff --git a/pyuno/zipcore/python.cxx b/pyuno/zipcore/python.cxx
index 2e0e1ea0acb4..80765830d056 100644
--- a/pyuno/zipcore/python.cxx
+++ b/pyuno/zipcore/python.cxx
@@ -206,7 +206,7 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
MultiByteToWideChar(CP_ACP, 0, argv[i], -1, buff, nNeededWStrBuffSize);
buff[nNeededWStrBuffSize] = 0;
cp = encode(cp, buff);
- delete buff;
+ delete [] buff;
#else
cp = encode(cp, argv[i]);
#endif
@@ -235,9 +235,9 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
exit(EXIT_FAILURE);
}
if (n != 0) {
- delete orig;
+ delete [] orig;
}
- delete value;
+ delete [] value;
n = GetEnvironmentVariableW(L"PYTHONPATH", NULL, 0);
if (n == 0) {
if (GetLastError() != ERROR_ENVVAR_NOT_FOUND) {
@@ -276,9 +276,9 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
exit(EXIT_FAILURE);
}
if (n != 0) {
- delete orig;
+ delete [] orig;
}
- delete value;
+ delete [] value;
if (!SetEnvironmentVariableW(L"PYTHONHOME", pythonhome)) {
exit(EXIT_FAILURE);
}
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx
index f8de7e20b148..281c8e27cbf0 100644
--- a/registry/source/keyimpl.cxx
+++ b/registry/source/keyimpl.cxx
@@ -365,6 +365,7 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal
return REG_SET_VALUE_FAILED;
}
+ rValue.flush();
rtl_freeMemory(pBuffer);
return REG_NO_ERROR;
}
@@ -423,6 +424,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32* pValueL
return REG_SET_VALUE_FAILED;
}
+ rValue.flush();
rtl_freeMemory(pBuffer);
return REG_NO_ERROR;
}
@@ -490,6 +492,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu
return REG_SET_VALUE_FAILED;
}
+ rValue.flush();
rtl_freeMemory(pBuffer);
return REG_NO_ERROR;
}
@@ -557,6 +560,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p
return REG_SET_VALUE_FAILED;
}
+ rValue.flush();
rtl_freeMemory(pBuffer);
return REG_NO_ERROR;
}
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx
index 86165b42bd1d..8a4dd8b88ee9 100644
--- a/registry/source/regimpl.cxx
+++ b/registry/source/regimpl.cxx
@@ -550,6 +550,7 @@ RegError ORegistry::closeRegistry()
if (m_file.isValid())
{
closeKey(m_openKeyTable[ROOT]);
+ m_file.flush();
m_file.close();
m_isOpen = sal_False;
return REG_NO_ERROR;
@@ -847,6 +848,7 @@ RegError ORegistry::eraseKey(ORegKey* pKey, const OUString& keyName)
{
return REG_DELETE_KEY_FAILED;
}
+ sFile.flush();
// set flag deleted !!!
((ORegKey*)hOldKey)->setDeleted(sal_True);
@@ -892,6 +894,7 @@ RegError ORegistry::deleteSubkeysAndValues(ORegKey* pKey)
{
return REG_DELETE_VALUE_FAILED;
}
+ ((OStoreFile&)pKey->getStoreFile()).flush();
}
_err = rStoreDir.next(iter);
@@ -1062,6 +1065,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
{
return REG_VALUE_NOT_EXISTS;
}
+ pSourceKey->getStoreFile().flush();
pBuffer = (sal_uInt8*)rtl_allocateMemory(VALUE_HEADERSIZE);
@@ -1133,6 +1137,7 @@ RegError ORegistry::loadAndSaveValue(ORegKey* pTargetKey,
rtl_freeMemory(pBuffer);
return REG_INVALID_VALUE;
}
+ rTargetFile.flush();
if (rwBytes != nSize)
{
diff --git a/registry/test/testmerge.cxx b/registry/test/testmerge.cxx
index 7cff15412745..efea89caf837 100644
--- a/registry/test/testmerge.cxx
+++ b/registry/test/testmerge.cxx
@@ -320,42 +320,42 @@ void test_merge()
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey2/KeyWithStringValue"), (RegValue)Value), "testMerge error 76.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 76.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 77");
REG_ENSURE(valueType == RG_VALUETYPE_UNICODE && valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 78");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey3/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 78.a)");
REG_ENSURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 78.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 79");
REG_ENSURE(valueType == RG_VALUETYPE_BINARY && valueSize == 27, "testMerge error 80");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1/MK1SubKey4/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 80.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, "abcdefghijklmnopqrstuvwxyz") == 0, "testMerge error 80.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 81");
REG_ENSURE(valueType == RG_VALUETYPE_BINARY && valueSize == 11, "testMerge error 82");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey1/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 82.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, "1234567890") == 0, "testMerge error 82.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 83");
REG_ENSURE(valueType == RG_VALUETYPE_UNICODE&& valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 84");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey2/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 84.a)");
REG_ENSURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 84.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), &valueType, &valueSize), "testMerge error 85");
REG_ENSURE(valueType == RG_VALUETYPE_STRING && valueSize == strlen(sValue)+1, "testMerge error 86");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey2/MK2SubKey3/KeyWithStringValue"), (RegValue)Value), "testMerge error 86.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 86.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey2/MK2SubKey4/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 87");
REG_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 88");
@@ -372,21 +372,21 @@ void test_merge()
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK1SubKey12/KeyWithStringValue"), (RegValue)Value), "testMerge error 92.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 92.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), &valueType, &valueSize), "testMerge error 93");
REG_ENSURE(valueType == RG_VALUETYPE_UNICODE && valueSize == (wValue.getLength()+1)*sizeof(sal_Unicode), "testMerge error 94");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK1SubKey13/KeyWithUnicodeValue"), (RegValue)Value), "testMerge error 94.a)");
REG_ENSURE(wValue.equals( (const sal_Unicode*)Value ), "testMerge error 94.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), &valueType, &valueSize), "testMerge error 95");
REG_ENSURE(valueType == RG_VALUETYPE_BINARY && valueSize == 19, "testMerge error 96");
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK2SubKey21/KeyWithBinaryValue"), (RegValue)Value), "testMerge error 96.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, "a1b2c3d4e5f6g7h8i9") == 0, "testMerge error 96.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK2SubKey22/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 97");
REG_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 98");
@@ -398,7 +398,7 @@ void test_merge()
Value = new sal_uInt8[valueSize];
REG_ENSURE(!key1.getValue(OUString::createFromAscii("/MergeKey1u2/MK2SubKey23/KeyWithStringValue"), (RegValue)Value), "testMerge error 100.a)");
REG_ENSURE(strcmp((const sal_Char*)Value, sValue) == 0, "testMerge error 100.b)");
- delete(Value);
+ delete [] Value;
REG_ENSURE(!key1.getValueInfo(OUString::createFromAscii("/MergeKey1u2/MK12SubKey1u2/KeyWithLongValue"), &valueType, &valueSize), "testMerge error 101");
REG_ENSURE(valueType == RG_VALUETYPE_LONG && valueSize == sizeof(sal_Int32), "testMerge error 102");
@@ -416,7 +416,7 @@ void test_merge()
REG_ENSURE(!myRegistry->destroy( OUString::createFromAscii("merge2.rdb") ), "test_registry_CppApi error 12");
REG_ENSURE(!myRegistry->destroy( OUString() ), "test_registry_CppApi error 13");
- delete(myRegistry);
+ delete myRegistry;
cout << "test_merge() Ok!\n";
return;
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index b69849a08cdc..8e7d76cda614 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -44,6 +44,7 @@
#include <limits>
#include <string.h>
+#include <pthread.h>
#include <sys/mman.h>
#if defined(MACOSX)
@@ -74,8 +75,9 @@
******************************************************************/
struct FileHandle_Impl
{
- rtl_String * m_strFilePath; /* holds native file path */
- int m_fd;
+ pthread_mutex_t m_mutex;
+ rtl_String * m_strFilePath; /* holds native file path */
+ int m_fd;
/** State
*/
@@ -169,6 +171,17 @@ struct FileHandle_Impl
Allocator();
~Allocator();
};
+
+ /** Guard.
+ */
+ class Guard
+ {
+ pthread_mutex_t * m_mutex;
+
+ public:
+ explicit Guard(pthread_mutex_t * pMutex);
+ ~Guard();
+ };
};
/*******************************************************************
@@ -213,6 +226,18 @@ void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer)
rtl_cache_free (m_cache, pBuffer);
}
+FileHandle_Impl::Guard::Guard(pthread_mutex_t * pMutex)
+ : m_mutex (pMutex)
+{
+ OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::Guard(): null pointer.");
+ (void) pthread_mutex_lock (m_mutex); // ignoring EINVAL ...
+}
+FileHandle_Impl::Guard::~Guard()
+{
+ OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::~Guard(): null pointer.");
+ (void) pthread_mutex_unlock (m_mutex);
+}
+
FileHandle_Impl::FileHandle_Impl (int fd, char const * path)
: m_strFilePath (0),
m_fd (fd),
@@ -225,6 +250,7 @@ FileHandle_Impl::FileHandle_Impl (int fd, char const * path)
m_bufsiz (0),
m_buffer (0)
{
+ (void) pthread_mutex_init(&m_mutex, 0);
rtl_string_newFromStr (&m_strFilePath, path);
Allocator::get().allocate (&m_buffer, &m_bufsiz);
if (0 != m_buffer)
@@ -234,6 +260,7 @@ FileHandle_Impl::~FileHandle_Impl()
{
Allocator::get().deallocate (m_buffer), m_buffer = 0;
rtl_string_release (m_strFilePath), m_strFilePath = 0;
+ (void) pthread_mutex_destroy(&m_mutex); // ignoring EBUSY ...
}
void* FileHandle_Impl::operator new (size_t n)
@@ -948,6 +975,8 @@ SAL_CALL osl_closeFile( oslFileHandle Handle )
if ((pImpl == 0) || (pImpl->m_fd < 0))
return osl_File_E_INVAL;
+ (void) pthread_mutex_lock (&(pImpl->m_mutex));
+
/* close(2) implicitly (and unconditionally) unlocks */
OSL_TRACE("osl_closeFile(%d) => %s", pImpl->m_fd, rtl_string_getStr(pImpl->m_strFilePath));
oslFileError result = pImpl->syncFile();
@@ -962,6 +991,7 @@ SAL_CALL osl_closeFile( oslFileHandle Handle )
result = oslTranslateFileError (OSL_FET_ERROR, errno);
}
+ (void) pthread_mutex_unlock (&(pImpl->m_mutex));
delete pImpl;
return (result);
}
@@ -977,6 +1007,8 @@ SAL_CALL osl_syncFile(oslFileHandle Handle)
if ((0 == pImpl) || (-1 == pImpl->m_fd))
return osl_File_E_INVAL;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
+
OSL_FILE_TRACE("osl_syncFile(%d)", pImpl->m_fd);
oslFileError result = pImpl->syncFile();
if (result != osl_File_E_None)
@@ -1086,6 +1118,7 @@ SAL_CALL osl_readLine (
sal_uInt64 uBytesRead = 0;
// read at current fileptr; fileptr += uBytesRead;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
oslFileError result = pImpl->readLineAt (
pImpl->m_fileptr, ppSequence, &uBytesRead);
if (result == osl_File_E_None)
@@ -1114,6 +1147,7 @@ SAL_CALL osl_readFile (
size_t const nBytesRequested = sal::static_int_cast< size_t >(uBytesRequested);
// read at current fileptr; fileptr += *pBytesRead;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
oslFileError result = pImpl->readFileAt (
pImpl->m_fileptr, pBuffer, nBytesRequested, pBytesRead);
if (result == osl_File_E_None)
@@ -1144,6 +1178,7 @@ SAL_CALL osl_writeFile (
size_t const nBytesToWrite = sal::static_int_cast< size_t >(uBytesToWrite);
// write at current fileptr; fileptr += *pBytesWritten;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
oslFileError result = pImpl->writeFileAt (
pImpl->m_fileptr, pBuffer, nBytesToWrite, pBytesWritten);
if (result == osl_File_E_None)
@@ -1180,6 +1215,7 @@ SAL_CALL osl_readFileAt (
size_t const nBytesRequested = sal::static_int_cast< size_t >(uBytesRequested);
// read at specified fileptr
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
return pImpl->readFileAt (nOffset, pBuffer, nBytesRequested, pBytesRead);
}
@@ -1214,6 +1250,7 @@ SAL_CALL osl_writeFileAt (
size_t const nBytesToWrite = sal::static_int_cast< size_t >(uBytesToWrite);
// write at specified fileptr
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
return pImpl->writeFileAt (nOffset, pBuffer, nBytesToWrite, pBytesWritten);
}
@@ -1228,6 +1265,7 @@ SAL_CALL osl_isEndOfFile( oslFileHandle Handle, sal_Bool *pIsEOF )
if ((0 == pImpl) || (-1 == pImpl->m_fd) || (0 == pIsEOF))
return osl_File_E_INVAL;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
*pIsEOF = (pImpl->getPos() == pImpl->getSize());
return osl_File_E_None;
}
@@ -1243,6 +1281,7 @@ SAL_CALL osl_getFilePos( oslFileHandle Handle, sal_uInt64* pPos )
if ((0 == pImpl) || (-1 == pImpl->m_fd) || (0 == pPos))
return osl_File_E_INVAL;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
*pPos = pImpl->getPos();
return osl_File_E_None;
}
@@ -1263,6 +1302,7 @@ SAL_CALL osl_setFilePos (oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uOffse
return osl_File_E_OVERFLOW;
off_t nPos = 0, nOffset = sal::static_int_cast< off_t >(uOffset);
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
switch(uHow)
{
case osl_Pos_Absolut:
@@ -1304,6 +1344,7 @@ SAL_CALL osl_getFileSize( oslFileHandle Handle, sal_uInt64* pSize )
if ((0 == pImpl) || (-1 == pImpl->m_fd) || (0 == pSize))
return osl_File_E_INVAL;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
*pSize = pImpl->getSize();
return osl_File_E_None;
}
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx
index d2eb9e7a4523..34deba2293da 100644
--- a/sal/osl/w32/file.cxx
+++ b/sal/osl/w32/file.cxx
@@ -69,7 +69,8 @@
//##################################################################
struct FileHandle_Impl
{
- HANDLE m_hFile;
+ CRITICAL_SECTION m_mutex;
+ HANDLE m_hFile;
/** State
*/
@@ -162,6 +163,17 @@ struct FileHandle_Impl
Allocator();
~Allocator();
};
+
+ /** Guard.
+ */
+ class Guard
+ {
+ LPCRITICAL_SECTION m_mutex;
+
+ public:
+ explicit Guard(LPCRITICAL_SECTION pMutex);
+ ~Guard();
+ };
};
FileHandle_Impl::Allocator &
@@ -199,6 +211,18 @@ void FileHandle_Impl::Allocator::deallocate (sal_uInt8 * pBuffer)
rtl_cache_free (m_cache, pBuffer);
}
+FileHandle_Impl::Guard::Guard(LPCRITICAL_SECTION pMutex)
+ : m_mutex (pMutex)
+{
+ OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::Guard(): null pointer.");
+ ::EnterCriticalSection (m_mutex);
+}
+FileHandle_Impl::Guard::~Guard()
+{
+ OSL_PRECOND (m_mutex != 0, "FileHandle_Impl::Guard::~Guard(): null pointer.");
+ ::LeaveCriticalSection (m_mutex);
+}
+
FileHandle_Impl::FileHandle_Impl(HANDLE hFile)
: m_hFile (hFile),
m_state (STATE_READABLE | STATE_WRITEABLE),
@@ -210,6 +234,7 @@ FileHandle_Impl::FileHandle_Impl(HANDLE hFile)
m_bufsiz (0),
m_buffer (0)
{
+ ::InitializeCriticalSection (&m_mutex);
Allocator::get().allocate (&m_buffer, &m_bufsiz);
if (m_buffer != 0)
memset (m_buffer, 0, m_bufsiz);
@@ -218,6 +243,7 @@ FileHandle_Impl::FileHandle_Impl(HANDLE hFile)
FileHandle_Impl::~FileHandle_Impl()
{
Allocator::get().deallocate (m_buffer), m_buffer = 0;
+ ::DeleteCriticalSection (&m_mutex);
}
void * FileHandle_Impl::operator new(size_t n)
@@ -729,6 +755,8 @@ SAL_CALL osl_syncFile(oslFileHandle Handle)
if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile))
return osl_File_E_INVAL;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
+
oslFileError result = pImpl->syncFile();
if (result != osl_File_E_None)
return result;
@@ -747,6 +775,8 @@ SAL_CALL osl_closeFile(oslFileHandle Handle)
if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile))
return osl_File_E_INVAL;
+ ::EnterCriticalSection (&(pImpl->m_mutex));
+
oslFileError result = pImpl->syncFile();
if (result != osl_File_E_None)
{
@@ -759,6 +789,7 @@ SAL_CALL osl_closeFile(oslFileHandle Handle)
result = oslTranslateFileError( GetLastError() );
}
+ ::LeaveCriticalSection (&(pImpl->m_mutex));
delete pImpl;
return (result);
}
@@ -870,6 +901,7 @@ SAL_CALL osl_readLine(
sal_uInt64 uBytesRead = 0;
// read at current filepos; filepos += uBytesRead;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
oslFileError result = pImpl->readLineAt (
pImpl->m_filepos, ppSequence, &uBytesRead);
if (result == osl_File_E_None)
@@ -890,6 +922,7 @@ SAL_CALL osl_readFile(
return osl_File_E_INVAL;
// read at current filepos; filepos += *pBytesRead;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
oslFileError result = pImpl->readFileAt (
pImpl->m_filepos, pBuffer, uBytesRequested, pBytesRead);
if (result == osl_File_E_None)
@@ -911,6 +944,7 @@ SAL_CALL osl_writeFile(
return osl_File_E_INVAL;
// write at current filepos; filepos += *pBytesWritten;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
oslFileError result = pImpl->writeFileAt (
pImpl->m_filepos, pBuffer, uBytesToWrite, pBytesWritten);
if (result == osl_File_E_None)
@@ -940,6 +974,7 @@ SAL_CALL osl_readFileAt(
LONGLONG const nOffset = sal::static_int_cast< LONGLONG >(uOffset);
// read at specified fileptr
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
return pImpl->readFileAt (nOffset, pBuffer, uBytesRequested, pBytesRead);
}
@@ -965,6 +1000,7 @@ SAL_CALL osl_writeFileAt(
LONGLONG const nOffset = sal::static_int_cast< LONGLONG >(uOffset);
// write at specified fileptr
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
return pImpl->writeFileAt (nOffset, pBuffer, uBytesToWrite, pBytesWritten);
}
@@ -977,6 +1013,7 @@ SAL_CALL osl_isEndOfFile (oslFileHandle Handle, sal_Bool *pIsEOF)
if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile) || (0 == pIsEOF))
return osl_File_E_INVAL;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
*pIsEOF = (pImpl->getPos() == pImpl->getSize());
return osl_File_E_None;
}
@@ -989,6 +1026,7 @@ SAL_CALL osl_getFilePos(oslFileHandle Handle, sal_uInt64 *pPos)
if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile) || (0 == pPos))
return osl_File_E_INVAL;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
*pPos = pImpl->getPos();
return osl_File_E_None;
}
@@ -1006,6 +1044,7 @@ SAL_CALL osl_setFilePos(oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uOffset
return osl_File_E_OVERFLOW;
LONGLONG nPos = 0, nOffset = sal::static_int_cast< LONGLONG >(uOffset);
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
switch (uHow)
{
case osl_Pos_Absolut:
@@ -1045,6 +1084,7 @@ SAL_CALL osl_getFileSize (oslFileHandle Handle, sal_uInt64 *pSize)
if ((0 == pImpl) || !IsValidHandle(pImpl->m_hFile) || (0 == pSize))
return osl_File_E_INVAL;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
*pSize = pImpl->getSize();
return osl_File_E_None;
}
@@ -1064,6 +1104,7 @@ SAL_CALL osl_setFileSize (oslFileHandle Handle, sal_uInt64 uSize)
if (g_limit_longlong < uSize)
return osl_File_E_OVERFLOW;
+ FileHandle_Impl::Guard lock (&(pImpl->m_mutex));
oslFileError result = pImpl->syncFile();
if (result != osl_File_E_None)
return (result);
diff --git a/sal/rtl/source/macro.hxx b/sal/rtl/source/macro.hxx
index a007d9e1cdab..2f0b723d236a 100644
--- a/sal/rtl/source/macro.hxx
+++ b/sal/rtl/source/macro.hxx
@@ -94,6 +94,8 @@ this is inserted for the case that the preprocessor ignores error
# define THIS_ARCH "IA64"
#elif defined M68K
# define THIS_ARCH "M68K"
+#elif defined HPPA
+# define THIS_ARCH "HPPA"
#endif
#if ! defined THIS_ARCH
diff --git a/sal/typesconfig/typesconfig.c b/sal/typesconfig/typesconfig.c
index 932d80fd979a..c9d6ede62cb7 100644
--- a/sal/typesconfig/typesconfig.c
+++ b/sal/typesconfig/typesconfig.c
@@ -163,7 +163,7 @@ int check( TestFunc func, Type eT, void* p )
|* Letzte Aenderung
|*
*************************************************************************/
-#if defined(IA64) || defined(ARM32)
+#if defined(IA64) || defined(ARM32) || defined(HPPA)
int forceerror()
{
diff --git a/stoc/prj/build.lst b/stoc/prj/build.lst
index 4748ffcff26f..2550563c8c34 100644
--- a/stoc/prj/build.lst
+++ b/stoc/prj/build.lst
@@ -21,4 +21,4 @@ tc stoc\source\typeconv nmake - all tc_tcv tc_stserv tc_nservice tc_inc NULL
tc stoc\source\javavm nmake - all tc_jvm tc_inc NULL
tc stoc\source\javaloader nmake - all tc_jvload tc_inc NULL
tc stoc\source\uriproc nmake - all tc_uriproc tc_stserv tc_inc NULL
-tc stoc\util nmake - all tc_util tc_boot tc_stserv tc_tcv tc_uriproc tc_smgr tc_inc tc_sreg tc_defr tc_ireg tc_regtd tc_tdmng NULL
+tc stoc\util nmake - all tc_util tc_boot tc_stserv tc_tcv tc_uriproc tc_smgr tc_inc tc_sreg tc_defr tc_ireg tc_regtd tc_tdmng tc_sec NULL
diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx
index 1b6c74c371fd..4610bac425fd 100644
--- a/store/source/stordata.hxx
+++ b/store/source/stordata.hxx
@@ -93,7 +93,7 @@ struct OStoreDataPageData : public store::OStorePageData
{
base::m_aGuard.m_nMagic = store::htonl(self::theTypeId);
base::m_aDescr.m_nUsed = store::htons(self::thePageSize);
- memset (m_pData, 0, capacity());
+ if (capacity()) memset (m_pData, 0, capacity());
}
/** guard (external representation).
diff --git a/udkapi/util/target.pmk b/udkapi/util/target.pmk
index f6e7bc9beb3c..2a01738e7eb7 100644
--- a/udkapi/util/target.pmk
+++ b/udkapi/util/target.pmk
@@ -30,8 +30,8 @@
#*************************************************************************
$(OUT)$/misc$/$(TARGET).idls: makefile.mk
- -$(RM) $@
- $(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
+ $(COMMAND_ECHO)-$(RM) $@
+ $(COMMAND_ECHO)$(TYPE) $(mktmp $(foreach,i,$(IDLFILES) $(PACKAGE)$/$i)) >>$@
ALLTAR: $(OUT)$/misc$/$(TARGET).idls