Update ooo320-m1
[ooovba.git] / applied_patches / 0233-armeabi-softfp-buildfix.diff
blobcdcb2aed9057c17446beb2d62f6e0c75f1017160
1 --- bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx.old 2008-04-11 10:27:28.000000000 +0000
2 +++ bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx 2009-09-23 12:45:41.000000000 +0000
3 @@ -45,7 +45,17 @@
4 #include <stdio.h>
5 #include <string.h>
7 -#if defined(__ARM_EABI__) && !defined(__SOFTFP__)
8 +/*
9 + * Based on http://gcc.gnu.org/PR41443
10 + * References to __SOFTFP__ are incorrect for EABI; the __SOFTFP__ code
11 + * should be used for *soft-float ABI* whether or not VFP is enabled,
12 + * and __SOFTFP__ does specifically mean soft-float not soft-float ABI.
13 + *
14 + * Changing the conditionals to __SOFTFP__ || __ARM_EABI__ then
15 + * -mfloat-abi=softfp should work. -mfloat-abi=hard won't; that would
16 + * need both a new macro to identify the hard-VFP ABI.
17 + */
18 +#if !defined(__ARM_EABI__) && !defined(__SOFTFP__)
19 #error Not Implemented
22 @@ -103,7 +113,7 @@
24 void MapReturn(long r0, long r1, typelib_TypeClass eReturnType, void *pRegisterReturn)
26 -#ifndef __SOFTFP__
27 +#if !defined(__ARM_EABI__) && !defined(__SOFTFP__)
28 register float fret asm("f0");
29 register double dret asm("f0");
30 #endif
31 @@ -128,14 +138,14 @@
32 *(unsigned char*)pRegisterReturn = (unsigned char)r0;
33 break;
34 case typelib_TypeClass_FLOAT:
35 -#ifdef __SOFTFP__
36 +#if defined(__ARM_EABI__) || defined(__SOFTFP__)
37 ((long*)pRegisterReturn)[0] = r0;
38 #else
39 *(float*)pRegisterReturn = fret;
40 #endif
41 break;
42 case typelib_TypeClass_DOUBLE:
43 -#ifdef __SOFTFP__
44 +#if defined(__ARM_EABI__) || defined(__SOFTFP__)
45 ((long*)pRegisterReturn)[1] = r1;
46 ((long*)pRegisterReturn)[0] = r0;
47 #else