714
***********************************************************************
715
* STRUCT_OFFSET_CHECK -- */ /**
717
* \brief Check if the actual offsef of a member in a structure
718
* is what is expected
721
* \param[in] STRUCT Structure the member is a part of.
722
* \param[in] MEMBER Member to check the offset of.
723
* \param[in] OFFSET Expected offset of MEMBER in STRUCTURE.
724
* \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to
725
* compensate for extra info in debug builds.
727
***********************************************************************
730
#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \
731
ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA))
733
#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \
734
ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET)
738
***********************************************************************
739
* STRUCT_SIZE_CHECK -- */ /**
741
* \brief Check if the actual size of a structure is what is expected
744
* \param[in] STRUCT Structure whose size is to be checked.
745
* \param[in] SIZE Expected size of STRUCT.
746
* \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to
747
* compensate for extra info in debug builds.
749
***********************************************************************
752
#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \
753
ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA))
755
#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \
756
ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE)
710
760
* __func__ is a stringified function name that is part of the C99 standard. The block
711
761
* below defines __func__ on older systems where the compiler does not support that