diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-06-30 14:08:42 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-06-30 14:08:42 +0000 |
commit | 797c325f16f2bc29630de5036af27c42e6d12581 (patch) | |
tree | 5ea64ddba0d868c24497c313bec22c4781d0207e /cppu | |
parent | e58de996e55b94436447a9bb0c63eebc7ba49327 (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')
-rw-r--r-- | cppu/source/typelib/typelib.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
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; |