Add FIELD_SIZEOF macro to types.h
authorKevin O'Connor <kevin@koconnor.net>
Wed, 12 Mar 2008 02:14:15 +0000 (22:14 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Wed, 12 Mar 2008 02:14:15 +0000 (22:14 -0400)
src/types.h

index 0a7e2f7..7e09de6 100644 (file)
@@ -27,6 +27,7 @@ typedef u32 size_t;
 
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
 
 #define NULL ((void *)0)