98a4dc8
From af73a28e8538f5b2df6bbfd592d8987511520d4d Mon Sep 17 00:00:00 2001
98a4dc8
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
98a4dc8
Date: Fri, 22 Aug 2014 21:08:47 +0100
98a4dc8
Subject: [PATCH] if _CALL_ELF -> if defined(_CALL_ELF) && _CALL_ELF == 2
98a4dc8
98a4dc8
Change-Id: I34e9a98586b795a3fa31ae775aee7898b36e65d4
98a4dc8
---
98a4dc8
 bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx | 10 +++++-----
98a4dc8
 bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx |  8 ++++----
98a4dc8
 2 files changed, 9 insertions(+), 9 deletions(-)
98a4dc8
98a4dc8
diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx
98a4dc8
index 35cc16f..430999f 100644
98a4dc8
--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx
98a4dc8
+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx
98a4dc8
@@ -326,7 +326,7 @@ static typelib_TypeClass cpp2uno_call(
98a4dc8
     }
98a4dc8
 }
98a4dc8
 
98a4dc8
-#if _CALL_ELF == 2
98a4dc8
+#if defined(_CALL_ELF) && _CALL_ELF == 2
98a4dc8
 #  define PARAMSAVE 32
98a4dc8
 #else
98a4dc8
 #  define PARAMSAVE 48
98a4dc8
@@ -545,7 +545,7 @@ extern "C" void privateSnippetExecutor( ... )
98a4dc8
                 "mr     %0,    1\n\t"
98a4dc8
                 : "=r" (sp) : );
98a4dc8
 
98a4dc8
-#if _CALL_ELF == 2
98a4dc8
+#if defined(_CALL_ELF) && _CALL_ELF == 2
98a4dc8
     volatile long nRegReturn[2];
98a4dc8
 #else
98a4dc8
     volatile long nRegReturn[1];
98a4dc8
@@ -592,7 +592,7 @@ extern "C" void privateSnippetExecutor( ... )
98a4dc8
         default:
98a4dc8
             __asm__( "ld 3,%0\n\t"
98a4dc8
                 : : "m" (nRegReturn[0]) );
98a4dc8
-#if _CALL_ELF == 2
98a4dc8
+#if defined(_CALL_ELF) && _CALL_ELF == 2
98a4dc8
             __asm__( "ld 4,%0\n\t"
98a4dc8
                 : : "m" (nRegReturn[1]) );
98a4dc8
 #endif
98a4dc8
@@ -600,7 +600,7 @@ extern "C" void privateSnippetExecutor( ... )
98a4dc8
     }
98a4dc8
 }
98a4dc8
 
98a4dc8
-#if _CALL_ELF == 2
98a4dc8
+#if defined(_CALL_ELF) && _CALL_ELF == 2
98a4dc8
 const int codeSnippetSize = 32;
98a4dc8
 #else
98a4dc8
 const int codeSnippetSize = 24;
98a4dc8
@@ -618,7 +618,7 @@ unsigned char *  codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sa
98a4dc8
 
98a4dc8
     if ( bHasHiddenParam )
98a4dc8
         nOffsetAndIndex |= 0x80000000;
98a4dc8
-#if _CALL_ELF == 2
98a4dc8
+#if defined(_CALL_ELF) && _CALL_ELF == 2
98a4dc8
     unsigned int *raw = (unsigned int *)&code[0];
98a4dc8
 
98a4dc8
     raw[0] = 0xe96c0018;        /* 0:   ld      11,2f-0b(12)    */
98a4dc8
diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
98a4dc8
index 391ef219..cfe720d 100644
98a4dc8
--- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
98a4dc8
+++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx
98a4dc8
@@ -39,7 +39,7 @@ using namespace ::com::sun::star::uno;
98a4dc8
 
98a4dc8
 namespace ppc64
98a4dc8
 {
98a4dc8
-#if _CALL_ELF == 2
98a4dc8
+#if defined(_CALL_ELF) && _CALL_ELF == 2
98a4dc8
     bool is_complex_struct(const typelib_TypeDescription * type)
98a4dc8
     {
98a4dc8
         const typelib_CompoundTypeDescription * p
98a4dc8
@@ -70,7 +70,7 @@ namespace ppc64
98a4dc8
     {
98a4dc8
         if (bridges::cpp_uno::shared::isSimpleType(pTypeRef))
98a4dc8
             return false;
98a4dc8
-#if _CALL_ELF == 2
98a4dc8
+#if defined(_CALL_ELF) && _CALL_ELF == 2
98a4dc8
         else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION)
98a4dc8
         {
98a4dc8
             typelib_TypeDescription * pTypeDescr = 0;
98a4dc8
@@ -115,7 +115,7 @@ void MapReturn(long r3, long r4, double dret, typelib_TypeDescriptionReference*
98a4dc8
     case typelib_TypeClass_DOUBLE:
98a4dc8
             *reinterpret_cast<double *>( pRegisterReturn ) = dret;
98a4dc8
             break;
98a4dc8
-#if _CALL_ELF == 2
98a4dc8
+#if defined(_CALL_ELF) && _CALL_ELF == 2
98a4dc8
     case typelib_TypeClass_STRUCT:
98a4dc8
     case typelib_TypeClass_EXCEPTION:
98a4dc8
             if (!ppc64::return_in_hidden_param(pReturnType))
98a4dc8
@@ -175,7 +175,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex,
98a4dc8
     pMethod += 8 * nVtableIndex;
98a4dc8
     pMethod = *((sal_uInt64 *)pMethod);
98a4dc8
 
98a4dc8
-#if _CALL_ELF == 2
98a4dc8
+#if defined(_CALL_ELF) && _CALL_ELF == 2
98a4dc8
     typedef void (* FunctionCall )(...);
98a4dc8
 #else
98a4dc8
     typedef void (* FunctionCall )( sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64, sal_uInt64 );
98a4dc8
-- 
98a4dc8
1.9.3
98a4dc8