From 797c325f16f2bc29630de5036af27c42e6d12581 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Mon, 30 Jun 2008 14:08:42 +0000 Subject: 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 --- cppu/source/typelib/typelib.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cppu') diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index 60f54ce09e46..dd2de4e59bc9 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; -- cgit