Add SIZE_OF_STRUCT_MEMBER() macro.
Gets the size of a struct member, which requires a bit of additional syntax.
@@ -99,6 +99,13 @@ This is useful for determining how to correctly align a type in a buffer that is
***********************************************************************************************************************************/
#define ALIGN_OFFSET(type, bytes) (ALIGN_OF(type) - ((bytes) % ALIGN_OF(type)))
+/***********************************************************************************************************************************
+Determine size of a type in a struct
+
+Using sizeof() on a struct member requires additional syntax.
+***********************************************************************************************************************************/
+#define SIZE_OF_STRUCT_MEMBER(struct, member) sizeof(((struct){0}).member)
+
/***********************************************************************************************************************************
Determine the length of an array that can be determined at compile time
