From 8dde1ae7ba1dba0243e7d48a9094dfeddb168e11 Mon Sep 17 00:00:00 2001 From: "cantab.net!aia21" Date: Thu, 16 Sep 2004 22:43:10 +0000 Subject: [PATCH] Add offsetof() macro. (Logical change 1.561) --- include/ntfs/support.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/ntfs/support.h b/include/ntfs/support.h index a9e92cf7..ade65e08 100644 --- a/include/ntfs/support.h +++ b/include/ntfs/support.h @@ -46,6 +46,11 @@ #define max(a,b) ((a) >= (b) ? (a) : (b)) #endif +/* + * Useful macro for determining the offset of a struct member. + */ +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) + /* * Simple bit operation macros. NOTE: These are NOT atomic. */