summaryrefslogtreecommitdiff
path: root/cppu/source
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2008-06-30 14:08:42 +0000
committerVladimir Glazounov <vg@openoffice.org>2008-06-30 14:08:42 +0000
commit7405ff19c9d2f3cf35fcd0bada0da5800daf8646 (patch)
treedfa7d9fd4402b65a61986e20a4a37abb33a1eac2 /cppu/source
parent2701c77deada9764b79b3c66458e7ec48309f731 (diff)
INTEGRATION: CWS m68kport01 (1.34.6); FILE MERGED
2008/06/11 07:59:57 cmc 1.34.6.1: #i90600# m68k aligns to 16bits, not the natural boundary
Diffstat (limited to 'cppu/source')
-rw-r--r--cppu/source/typelib/typelib.cxx9
1 files changed, 8 insertions, 1 deletions
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index af9962d19..1e63483ac 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: typelib.cxx,v $
- * $Revision: 1.34 $
+ * $Revision: 1.35 $
*
* This file is part of OpenOffice.org.
*
@@ -1894,11 +1894,18 @@ extern "C" sal_Int32 SAL_CALL typelib_typedescription_getAlignedUnoSize(
if( nMaxIntegral > rMaxIntegralTypeSize )
rMaxIntegralTypeSize = nMaxIntegral;
}
+#ifdef __m68k__
+ // Anything that is at least 16 bits wide is aligned on a 16-bit
+ // boundary on the m68k default abi
+ sal_Int32 nMaxAlign = (rMaxIntegralTypeSize > 2) ? 2 : rMaxIntegralTypeSize;
+ nStructSize = (nStructSize + nMaxAlign -1) / nMaxAlign * nMaxAlign;
+#else
// Example: A { double; int; } structure has a size of 16 instead of 10. The
// compiler must follow this rule if it is possible to access members in arrays through:
// (Element *)((char *)pArray + sizeof( Element ) * ElementPos)
nStructSize = (nStructSize + rMaxIntegralTypeSize -1)
/ rMaxIntegralTypeSize * rMaxIntegralTypeSize;
+#endif
nSize += nStructSize;
}
break;