summaryrefslogtreecommitdiffstats
path: root/cppu
diff options
context:
space:
mode:
authorDaniel Boelzle <dbo@openoffice.org>2001-10-12 09:55:46 +0000
committerDaniel Boelzle <dbo@openoffice.org>2001-10-12 09:55:46 +0000
commit3bb252e1dcb881fbdb0f001f02ae73687cd2bc42 (patch)
tree6b6c165a0bad58288ca7e77534f051a18f7b7010 /cppu
parent#87140# Cleaned up, added EUC-TW and GB-18030. (diff)
downloadcore-3bb252e1dcb881fbdb0f001f02ae73687cd2bc42.tar.gz
core-3bb252e1dcb881fbdb0f001f02ae73687cd2bc42.zip
#92951# struct test cases
Diffstat (limited to 'cppu')
-rw-r--r--cppu/source/uno/data.cxx35
1 files changed, 33 insertions, 2 deletions
diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx
index e856f9e07500..a902c35811cc 100644
--- a/cppu/source/uno/data.cxx
+++ b/cppu/source/uno/data.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: data.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: dbo $ $Date: 2001-08-22 11:07:10 $
+ * last change: $Author: dbo $ $Date: 2001-10-12 10:55:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -293,6 +293,22 @@ sal_Bool SAL_CALL uno_assignData(
# pragma pack(8)
#endif
+#define OFFSET_OF( s, m ) ((sal_Size)((char *)&((s *)16)->m -16))
+
+struct D
+{
+ sal_Int16 d;
+ sal_Int32 e;
+};
+struct E
+{
+ sal_Bool a;
+ sal_Bool b;
+ sal_Bool c;
+ sal_Int16 d;
+ sal_Int32 e;
+};
+
struct M
{
sal_Int32 n;
@@ -390,6 +406,21 @@ BinaryCompatible_Impl::BinaryCompatible_Impl()
OSL_ENSURE( 0, "### unexpected struct alignment?!" );
abort();
}
+ if( sizeof( D ) != 8 )
+ {
+ OSL_ENSURE( 0, "### unexpected struct alignment?!" );
+ abort();
+ }
+ if( OFFSET_OF( D, e ) != 4 )
+ {
+ OSL_ENSURE( 0, "### unexpected struct alignment?!" );
+ abort();
+ }
+ if( OFFSET_OF( E, d ) != 4 || OFFSET_OF( E, e ) != 8 )
+ {
+ OSL_ENSURE( 0, "### unexpected struct alignment?!" );
+ abort();
+ }
#ifdef SAL_W32
if( sizeof( P ) != 24 )
{