702
***********************************************************************
703
* STRUCT_OFFSET_CHECK -- */ /**
705
* \brief Check if the actual offsef of a member in a structure
706
* is what is expected
709
* \param[in] STRUCT Structure the member is a part of.
710
* \param[in] MEMBER Member to check the offset of.
711
* \param[in] OFFSET Expected offset of MEMBER in STRUCTURE.
712
* \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to
713
* compensate for extra info in debug builds.
715
***********************************************************************
718
#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \
719
ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA))
721
#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \
722
ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET)
726
***********************************************************************
727
* STRUCT_SIZE_CHECK -- */ /**
729
* \brief Check if the actual size of a structure is what is expected
732
* \param[in] STRUCT Structure whose size is to be checked.
733
* \param[in] SIZE Expected size of STRUCT.
734
* \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to
735
* compensate for extra info in debug builds.
737
***********************************************************************
740
#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \
741
ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA))
743
#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \
744
ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE)
698
748
* __func__ is a stringified function name that is part of the C99 standard. The block
699
749
* below defines __func__ on older systems where the compiler does not support that