LCOV - code coverage report
Current view: top level - cppu/source/uno - data.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 16 94 17.0 %
Date: 2014-04-14 Functions: 6 22 27.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : 
      21             : #include <cstddef>
      22             : #include <stdio.h>
      23             : 
      24             : #include "cppu/macros.hxx"
      25             : 
      26             : #include "osl/mutex.hxx"
      27             : 
      28             : #include "constr.hxx"
      29             : #include "destr.hxx"
      30             : #include "copy.hxx"
      31             : #include "assign.hxx"
      32             : #include "eq.hxx"
      33             : 
      34             : #include "boost/static_assert.hpp"
      35             : 
      36             : 
      37             : using namespace ::cppu;
      38             : using namespace ::rtl;
      39             : using namespace ::osl;
      40             : 
      41             : 
      42             : namespace cppu
      43             : {
      44             : 
      45             : // Sequence<>() (default ctor) relies on this being static:
      46             : uno_Sequence g_emptySeq = { 1, 0, { 0 } };
      47             : typelib_TypeDescriptionReference * g_pVoidType = 0;
      48             : 
      49             : 
      50           0 : void * binuno_queryInterface( void * pUnoI, typelib_TypeDescriptionReference * pDestType )
      51             : {
      52             :     // init queryInterface() td
      53             :     static typelib_TypeDescription * g_pQITD = 0;
      54           0 :     if (0 == g_pQITD)
      55             :     {
      56           0 :         MutexGuard aGuard( Mutex::getGlobalMutex() );
      57           0 :         if (0 == g_pQITD)
      58             :         {
      59             :             typelib_TypeDescriptionReference * type_XInterface =
      60           0 :                 * typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE );
      61           0 :             typelib_InterfaceTypeDescription * pTXInterfaceDescr = 0;
      62           0 :             TYPELIB_DANGER_GET( (typelib_TypeDescription **) &pTXInterfaceDescr, type_XInterface );
      63             :             OSL_ASSERT( pTXInterfaceDescr->ppAllMembers );
      64             :             typelib_typedescriptionreference_getDescription(
      65           0 :                 &g_pQITD, pTXInterfaceDescr->ppAllMembers[ 0 ] );
      66           0 :             TYPELIB_DANGER_RELEASE( (typelib_TypeDescription *) pTXInterfaceDescr );
      67           0 :         }
      68             :     }
      69             : 
      70             :     uno_Any aRet, aExc;
      71           0 :     uno_Any * pExc = &aExc;
      72             :     void * aArgs[ 1 ];
      73           0 :     aArgs[ 0 ] = &pDestType;
      74             :     (*((uno_Interface *) pUnoI)->pDispatcher)(
      75           0 :         (uno_Interface *) pUnoI, g_pQITD, &aRet, aArgs, &pExc );
      76             : 
      77           0 :     uno_Interface * ret = 0;
      78           0 :     if (0 == pExc)
      79             :     {
      80           0 :         typelib_TypeDescriptionReference * ret_type = aRet.pType;
      81           0 :         switch (ret_type->eTypeClass)
      82             :         {
      83             :         case typelib_TypeClass_VOID: // common case
      84           0 :             typelib_typedescriptionreference_release( ret_type );
      85           0 :             break;
      86             :         case typelib_TypeClass_INTERFACE:
      87             :             // tweaky... avoiding acquire/ release pair
      88           0 :             typelib_typedescriptionreference_release( ret_type );
      89           0 :             ret = (uno_Interface *) aRet.pReserved; // serving acquired interface
      90           0 :             break;
      91             :         default:
      92           0 :             _destructAny( &aRet, 0 );
      93           0 :             break;
      94             :         }
      95             :     }
      96             :     else
      97             :     {
      98             : #if OSL_DEBUG_LEVEL > 1
      99             :         OUStringBuffer buf( 128 );
     100             :         buf.append( "### exception occurred querying for interface " );
     101             :         buf.append( * reinterpret_cast< OUString const * >( &pDestType->pTypeName ) );
     102             :         buf.append( ": [" );
     103             :         buf.append( * reinterpret_cast< OUString const * >( &pExc->pType->pTypeName ) );
     104             :         buf.append( "] " );
     105             :         // Message is very first member
     106             :         buf.append( * reinterpret_cast< OUString const * >( pExc->pData ) );
     107             :         OString cstr(
     108             :             OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US ) );
     109             :         OSL_FAIL( cstr.getStr() );
     110             : #endif
     111           0 :         uno_any_destruct( pExc, 0 );
     112             :     }
     113           0 :     return ret;
     114             : }
     115             : 
     116             : 
     117           0 : void defaultConstructStruct(
     118             :     void * pMem,
     119             :     typelib_CompoundTypeDescription * pCompType )
     120             :     SAL_THROW(())
     121             : {
     122           0 :     _defaultConstructStruct( pMem, pCompType );
     123           0 : }
     124             : 
     125           0 : void copyConstructStruct(
     126             :     void * pDest, void * pSource,
     127             :     typelib_CompoundTypeDescription * pTypeDescr,
     128             :     uno_AcquireFunc acquire, uno_Mapping * mapping )
     129             :     SAL_THROW(())
     130             : {
     131           0 :     _copyConstructStruct( pDest, pSource, pTypeDescr, acquire, mapping );
     132           0 : }
     133             : 
     134           0 : void destructStruct(
     135             :     void * pValue,
     136             :     typelib_CompoundTypeDescription * pTypeDescr,
     137             :     uno_ReleaseFunc release )
     138             :     SAL_THROW(())
     139             : {
     140           0 :     _destructStruct( pValue, pTypeDescr, release );
     141           0 : }
     142             : 
     143           0 : bool equalStruct(
     144             :     void * pDest, void *pSource,
     145             :     typelib_CompoundTypeDescription * pTypeDescr,
     146             :     uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release )
     147             :     SAL_THROW(())
     148             : {
     149           0 :     return _equalStruct( pDest, pSource, pTypeDescr, queryInterface, release );
     150             : }
     151             : 
     152           0 : bool assignStruct(
     153             :     void * pDest, void * pSource,
     154             :     typelib_CompoundTypeDescription * pTypeDescr,
     155             :     uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release )
     156             :     SAL_THROW(())
     157             : {
     158           0 :     return _assignStruct( pDest, pSource, pTypeDescr, queryInterface, acquire, release );
     159             : }
     160             : 
     161             : 
     162        3553 : uno_Sequence * copyConstructSequence(
     163             :     uno_Sequence * pSource,
     164             :     typelib_TypeDescriptionReference * pElementType,
     165             :     uno_AcquireFunc acquire, uno_Mapping * mapping )
     166             : {
     167        3553 :     return icopyConstructSequence( pSource, pElementType, acquire, mapping );
     168             : }
     169             : 
     170             : 
     171        3553 : void destructSequence(
     172             :     uno_Sequence * pSequence,
     173             :     typelib_TypeDescriptionReference * pType,
     174             :     typelib_TypeDescription * pTypeDescr,
     175             :     uno_ReleaseFunc release )
     176             : {
     177        3553 :     idestructSequence( pSequence, pType, pTypeDescr, release );
     178        3553 : }
     179             : 
     180             : 
     181           0 : bool equalSequence(
     182             :     uno_Sequence * pDest, uno_Sequence * pSource,
     183             :     typelib_TypeDescriptionReference * pElementType,
     184             :     uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release )
     185             :     SAL_THROW(())
     186             : {
     187           0 :     return _equalSequence( pDest, pSource, pElementType, queryInterface, release );
     188             : }
     189             : 
     190             : extern "C"
     191             : {
     192             : 
     193           0 : CPPU_DLLPUBLIC void SAL_CALL uno_type_constructData(
     194             :     void * pMem, typelib_TypeDescriptionReference * pType )
     195             :     SAL_THROW_EXTERN_C()
     196             : {
     197           0 :     _defaultConstructData( pMem, pType, 0 );
     198           0 : }
     199             : 
     200           0 : CPPU_DLLPUBLIC void SAL_CALL uno_constructData(
     201             :     void * pMem, typelib_TypeDescription * pTypeDescr )
     202             :     SAL_THROW_EXTERN_C()
     203             : {
     204           0 :     _defaultConstructData( pMem, pTypeDescr->pWeakRef, pTypeDescr );
     205           0 : }
     206             : 
     207         984 : CPPU_DLLPUBLIC void SAL_CALL uno_type_destructData(
     208             :     void * pValue, typelib_TypeDescriptionReference * pType,
     209             :     uno_ReleaseFunc release )
     210             :     SAL_THROW_EXTERN_C()
     211             : {
     212         984 :     _destructData( pValue, pType, 0, release );
     213         984 : }
     214             : 
     215           0 : CPPU_DLLPUBLIC void SAL_CALL uno_destructData(
     216             :     void * pValue,
     217             :     typelib_TypeDescription * pTypeDescr,
     218             :     uno_ReleaseFunc release )
     219             :     SAL_THROW_EXTERN_C()
     220             : {
     221           0 :     _destructData( pValue, pTypeDescr->pWeakRef, pTypeDescr, release );
     222           0 : }
     223             : 
     224           6 : CPPU_DLLPUBLIC void SAL_CALL uno_type_copyData(
     225             :     void * pDest, void * pSource,
     226             :     typelib_TypeDescriptionReference * pType,
     227             :     uno_AcquireFunc acquire )
     228             :     SAL_THROW_EXTERN_C()
     229             : {
     230           6 :     _copyConstructData( pDest, pSource, pType, 0, acquire, 0 );
     231           6 : }
     232             : 
     233           0 : CPPU_DLLPUBLIC void SAL_CALL uno_copyData(
     234             :     void * pDest, void * pSource,
     235             :     typelib_TypeDescription * pTypeDescr,
     236             :     uno_AcquireFunc acquire )
     237             :     SAL_THROW_EXTERN_C()
     238             : {
     239           0 :     _copyConstructData( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, acquire, 0 );
     240           0 : }
     241             : 
     242           0 : CPPU_DLLPUBLIC void SAL_CALL uno_type_copyAndConvertData(
     243             :     void * pDest, void * pSource,
     244             :     typelib_TypeDescriptionReference * pType,
     245             :     uno_Mapping * mapping )
     246             :     SAL_THROW_EXTERN_C()
     247             : {
     248           0 :     _copyConstructData( pDest, pSource, pType, 0, 0, mapping );
     249           0 : }
     250             : 
     251           0 : CPPU_DLLPUBLIC void SAL_CALL uno_copyAndConvertData(
     252             :     void * pDest, void * pSource,
     253             :     typelib_TypeDescription * pTypeDescr,
     254             :     uno_Mapping * mapping )
     255             :     SAL_THROW_EXTERN_C()
     256             : {
     257           0 :     _copyConstructData( pDest, pSource, pTypeDescr->pWeakRef, pTypeDescr, 0, mapping );
     258           0 : }
     259             : 
     260           0 : CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_equalData(
     261             :     void * pVal1, typelib_TypeDescriptionReference * pVal1Type,
     262             :     void * pVal2, typelib_TypeDescriptionReference * pVal2Type,
     263             :     uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release )
     264             :     SAL_THROW_EXTERN_C()
     265             : {
     266             :     return _equalData(
     267             :         pVal1, pVal1Type, 0,
     268             :         pVal2, pVal2Type,
     269           0 :         queryInterface, release );
     270             : }
     271             : 
     272           0 : CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_equalData(
     273             :     void * pVal1, typelib_TypeDescription * pVal1TD,
     274             :     void * pVal2, typelib_TypeDescription * pVal2TD,
     275             :     uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release )
     276             :     SAL_THROW_EXTERN_C()
     277             : {
     278             :     return _equalData(
     279             :         pVal1, pVal1TD->pWeakRef, pVal1TD,
     280             :         pVal2, pVal2TD->pWeakRef,
     281           0 :         queryInterface, release );
     282             : }
     283             : 
     284          41 : CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_assignData(
     285             :     void * pDest, typelib_TypeDescriptionReference * pDestType,
     286             :     void * pSource, typelib_TypeDescriptionReference * pSourceType,
     287             :     uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release )
     288             :     SAL_THROW_EXTERN_C()
     289             : {
     290             :     return _assignData(
     291             :         pDest, pDestType, 0,
     292             :         pSource, pSourceType, 0,
     293          41 :         queryInterface, acquire, release );
     294             : }
     295             : 
     296           0 : CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_assignData(
     297             :     void * pDest, typelib_TypeDescription * pDestTD,
     298             :     void * pSource, typelib_TypeDescription * pSourceTD,
     299             :     uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release )
     300             :     SAL_THROW_EXTERN_C()
     301             : {
     302             :     return _assignData(
     303             :         pDest, pDestTD->pWeakRef, pDestTD,
     304             :         pSource, pSourceTD->pWeakRef, pSourceTD,
     305           0 :         queryInterface, acquire, release );
     306             : }
     307             : 
     308           1 : CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_isAssignableFromData(
     309             :     typelib_TypeDescriptionReference * pAssignable,
     310             :     void * pFrom, typelib_TypeDescriptionReference * pFromType,
     311             :     uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release )
     312             :     SAL_THROW_EXTERN_C()
     313             : {
     314           1 :     if (::typelib_typedescriptionreference_isAssignableFrom( pAssignable, pFromType ))
     315           1 :         return sal_True;
     316           0 :     if (typelib_TypeClass_INTERFACE != pFromType->eTypeClass ||
     317           0 :         typelib_TypeClass_INTERFACE != pAssignable->eTypeClass)
     318             :     {
     319           0 :         return sal_False;
     320             :     }
     321             : 
     322             :     // query
     323           0 :     if (0 == pFrom)
     324           0 :         return sal_False;
     325           0 :     void * pInterface = *(void **)pFrom;
     326           0 :     if (0 == pInterface)
     327           0 :         return sal_False;
     328             : 
     329           0 :     if (0 == queryInterface)
     330           0 :         queryInterface = binuno_queryInterface;
     331           0 :     void * p = (*queryInterface)( pInterface, pAssignable );
     332           0 :     _release( p, release );
     333           0 :     return (0 != p);
     334             : }
     335             : }
     336             : 
     337             : 
     338             : 
     339             : 
     340             : 
     341             : 
     342             : 
     343             : #if OSL_DEBUG_LEVEL > 1
     344             : 
     345             : #if defined( SAL_W32)
     346             : #pragma pack(push, 8)
     347             : #endif
     348             : 
     349             : // Why hardcode like this instead of using the (generated)
     350             : // <sal/typesizes.h> ?
     351             : 
     352             : #if (defined(INTEL) \
     353             :     && (defined(__GNUC__) && (defined(LINUX) || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD)) \
     354             :         || defined(MACOSX) || defined(DRAGONFLY))) \
     355             :     || defined(IOS)
     356             : #define MAX_ALIGNMENT_4
     357             : #endif
     358             : 
     359             : #define OFFSET_OF( s, m ) reinterpret_cast< size_t >((char *)&((s *)16)->m -16)
     360             : 
     361             : #define BINTEST_VERIFY( c ) \
     362             :     if (! (c))      \
     363             :     {               \
     364             :         fprintf( stderr, "### binary compatibility test failed: %s [line %d]!!!\n", #c, __LINE__ ); \
     365             :         abort();    \
     366             :     }
     367             : 
     368             : #define BINTEST_VERIFYOFFSET( s, m, n ) \
     369             :     if (OFFSET_OF(s, m) != static_cast<size_t>(n))  \
     370             :     {                                               \
     371             :         fprintf(stderr, "### OFFSET_OF(" #s ", "  #m ") = %" SAL_PRI_SIZET "u instead of expected %" SAL_PRI_SIZET "u!!!\n", \
     372             :             OFFSET_OF(s, m), static_cast<size_t>(n));                    \
     373             :         abort();                                    \
     374             :     }
     375             : 
     376             : #define BINTEST_VERIFYSIZE( s, n ) \
     377             :     if (sizeof(s) != static_cast<size_t>(n))        \
     378             :     {                                               \
     379             :         fprintf(stderr, "### sizeof(" #s ") = %" SAL_PRI_SIZET "u instead of expected %" SAL_PRI_SIZET "u!!!\n", \
     380             :             sizeof(s), static_cast<size_t>(n));    \
     381             :         abort(); \
     382             :     }
     383             : 
     384             : struct C1
     385             : {
     386             :     sal_Int16 n1;
     387             : };
     388             : struct C2 : public C1
     389             : {
     390             :     sal_Int32 n2 CPPU_GCC3_ALIGN( C1 );
     391             : };
     392             : struct C3 : public C2
     393             : {
     394             :     double d3;
     395             :     sal_Int32 n3;
     396             : };
     397             : struct C4 : public C3
     398             : {
     399             :     sal_Int32 n4 CPPU_GCC3_ALIGN( C3 );
     400             :     double d4;
     401             : };
     402             : struct C5 : public C4
     403             : {
     404             :     sal_Int64 n5;
     405             :     sal_Bool b5;
     406             : };
     407             : struct C6 : public C1
     408             : {
     409             :     C5 c6 CPPU_GCC3_ALIGN( C1 );
     410             :     sal_Bool b6;
     411             : };
     412             : 
     413             : struct D
     414             : {
     415             :     sal_Int16 d;
     416             :     sal_Int32 e;
     417             : };
     418             : struct E
     419             : {
     420             :     sal_Bool a;
     421             :     sal_Bool b;
     422             :     sal_Bool c;
     423             :     sal_Int16 d;
     424             :     sal_Int32 e;
     425             : };
     426             : 
     427             : struct M
     428             : {
     429             :     sal_Int32   n;
     430             :     sal_Int16   o;
     431             : };
     432             : 
     433             : struct N : public M
     434             : {
     435             :     sal_Int16   p CPPU_GCC3_ALIGN( M );
     436             : };
     437             : struct N2
     438             : {
     439             :     M m;
     440             :     sal_Int16   p;
     441             : };
     442             : 
     443             : struct O : public M
     444             : {
     445             :     double  p;
     446             :     sal_Int16 q;
     447             : };
     448             : struct O2 : public O
     449             : {
     450             :     sal_Int16 p2 CPPU_GCC3_ALIGN( O );
     451             : };
     452             : 
     453             : struct P : public N
     454             : {
     455             :     double  p2;
     456             : };
     457             : 
     458             : struct empty
     459             : {
     460             : };
     461             : struct second : public empty
     462             : {
     463             :     int a;
     464             : };
     465             : 
     466             : struct AlignSize_Impl
     467             : {
     468             :     sal_Int16   nInt16;
     469             :     double      dDouble;
     470             : };
     471             : 
     472             : struct Char1
     473             : {
     474             :     char c1;
     475             : };
     476             : struct Char2 : public Char1
     477             : {
     478             :     char c2 CPPU_GCC3_ALIGN( Char1 );
     479             : };
     480             : struct Char3 : public Char2
     481             : {
     482             :     char c3 CPPU_GCC3_ALIGN( Char2 );
     483             : };
     484             : struct Char4
     485             : {
     486             :     Char3 chars;
     487             :     char c;
     488             : };
     489             : class Ref
     490             : {
     491             :     void * p;
     492             : };
     493             : enum Enum
     494             : {
     495             :     v = SAL_MAX_ENUM
     496             : };
     497             : 
     498             : 
     499             : class BinaryCompatible_Impl
     500             : {
     501             : public:
     502             :     BinaryCompatible_Impl();
     503             : };
     504             : BinaryCompatible_Impl::BinaryCompatible_Impl()
     505             : {
     506             :     BOOST_STATIC_ASSERT( ((sal_Bool) true) == sal_True &&
     507             :                          (1 != 0) == sal_True );
     508             :     BOOST_STATIC_ASSERT( ((sal_Bool) false) == sal_False &&
     509             :                          (1 == 0) == sal_False );
     510             : #ifdef MAX_ALIGNMENT_4
     511             :     // max alignment is 4
     512             :     BINTEST_VERIFYOFFSET( AlignSize_Impl, dDouble, 4 );
     513             :     BINTEST_VERIFYSIZE( AlignSize_Impl, 12 );
     514             : #else
     515             :     // max alignment is 8
     516             :     BINTEST_VERIFYOFFSET( AlignSize_Impl, dDouble, 8 );
     517             :     BINTEST_VERIFYSIZE( AlignSize_Impl, 16 );
     518             : #endif
     519             : 
     520             :     // sequence
     521             :     BINTEST_VERIFY( (SAL_SEQUENCE_HEADER_SIZE % 8) == 0 );
     522             :     // enum
     523             :     BINTEST_VERIFY( sizeof( Enum ) == sizeof( sal_Int32 ) );
     524             :     // any
     525             :     BINTEST_VERIFY( sizeof(void *) >= sizeof(sal_Int32) );
     526             :     BINTEST_VERIFY( sizeof( uno_Any ) == sizeof( void * ) * 3 );
     527             :     BINTEST_VERIFYOFFSET( uno_Any, pType, 0 );
     528             :     BINTEST_VERIFYOFFSET( uno_Any, pData, 1 * sizeof (void *) );
     529             :     BINTEST_VERIFYOFFSET( uno_Any, pReserved, 2 * sizeof (void *) );
     530             :     // interface
     531             :     BINTEST_VERIFY( sizeof( Ref ) == sizeof( void * ) );
     532             :     // string
     533             :     BINTEST_VERIFY( sizeof( OUString ) == sizeof( rtl_uString * ) );
     534             :     // struct
     535             :     BINTEST_VERIFYSIZE( M, 8 );
     536             :     BINTEST_VERIFYOFFSET( M, o, 4 );
     537             :     BINTEST_VERIFYSIZE( N, 12 );
     538             :     BINTEST_VERIFYOFFSET( N, p, 8 );
     539             :     BINTEST_VERIFYSIZE( N2, 12 );
     540             :     BINTEST_VERIFYOFFSET( N2, p, 8 );
     541             : #ifdef MAX_ALIGNMENT_4
     542             :     BINTEST_VERIFYSIZE( O, 20 );
     543             : #else
     544             :     BINTEST_VERIFYSIZE( O, 24 );
     545             : #endif
     546             :     BINTEST_VERIFYSIZE( D, 8 );
     547             :     BINTEST_VERIFYOFFSET( D, e, 4 );
     548             :     BINTEST_VERIFYOFFSET( E, d, 4 );
     549             :     BINTEST_VERIFYOFFSET( E, e, 8 );
     550             : 
     551             :     BINTEST_VERIFYSIZE( C1, 2 );
     552             :     BINTEST_VERIFYSIZE( C2, 8 );
     553             :     BINTEST_VERIFYOFFSET( C2, n2, 4 );
     554             : 
     555             : #ifdef MAX_ALIGNMENT_4
     556             :     BINTEST_VERIFYSIZE( C3, 20 );
     557             :     BINTEST_VERIFYOFFSET( C3, d3, 8 );
     558             :     BINTEST_VERIFYOFFSET( C3, n3, 16 );
     559             :     BINTEST_VERIFYSIZE( C4, 32 );
     560             :     BINTEST_VERIFYOFFSET( C4, n4, 20 );
     561             :     BINTEST_VERIFYOFFSET( C4, d4, 24 );
     562             :     BINTEST_VERIFYSIZE( C5, 44 );
     563             :     BINTEST_VERIFYOFFSET( C5, n5, 32 );
     564             :     BINTEST_VERIFYOFFSET( C5, b5, 40 );
     565             :     BINTEST_VERIFYSIZE( C6, 52 );
     566             :     BINTEST_VERIFYOFFSET( C6, c6, 4 );
     567             :     BINTEST_VERIFYOFFSET( C6, b6, 48 );
     568             : 
     569             :     BINTEST_VERIFYSIZE( O2, 24 );
     570             :     BINTEST_VERIFYOFFSET( O2, p2, 20 );
     571             : #else
     572             :     BINTEST_VERIFYSIZE( C3, 24 );
     573             :     BINTEST_VERIFYOFFSET( C3, d3, 8 );
     574             :     BINTEST_VERIFYOFFSET( C3, n3, 16 );
     575             :     BINTEST_VERIFYSIZE( C4, 40 );
     576             :     BINTEST_VERIFYOFFSET( C4, n4, 24 );
     577             :     BINTEST_VERIFYOFFSET( C4, d4, 32 );
     578             :     BINTEST_VERIFYSIZE( C5, 56 );
     579             :     BINTEST_VERIFYOFFSET( C5, n5, 40 );
     580             :     BINTEST_VERIFYOFFSET( C5, b5, 48 );
     581             :     BINTEST_VERIFYSIZE( C6, 72 );
     582             :     BINTEST_VERIFYOFFSET( C6, c6, 8 );
     583             :     BINTEST_VERIFYOFFSET( C6, b6, 64 );
     584             : 
     585             :     BINTEST_VERIFYSIZE( O2, 32 );
     586             :     BINTEST_VERIFYOFFSET( O2, p2, 24 );
     587             : #endif
     588             : 
     589             :     BINTEST_VERIFYSIZE( Char3, 3 );
     590             :     BINTEST_VERIFYOFFSET( Char4, c, 3 );
     591             : 
     592             : #ifdef MAX_ALIGNMENT_4
     593             :     // max alignment is 4
     594             :     BINTEST_VERIFYSIZE( P, 20 );
     595             : #else
     596             :     // alignment of P is 8, because of P[] ...
     597             :     BINTEST_VERIFYSIZE( P, 24 );
     598             :     BINTEST_VERIFYSIZE( second, sizeof( int ) );
     599             : #endif
     600             : }
     601             : 
     602             : #ifdef SAL_W32
     603             : #   pragma pack(pop)
     604             : #endif
     605             : 
     606             : static BinaryCompatible_Impl aTest;
     607             : 
     608             : #endif
     609             : 
     610             : }
     611             : 
     612             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10