[PATCH 1/4] include: Define FIELD_OFFSET to the standard offsetof

Amine Khaldi amine.khaldi at reactos.org
Mon Dec 10 16:14:02 CST 2012


---
 include/winnt.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/winnt.h b/include/winnt.h
index 207adaa..40f1639 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -746,8 +746,7 @@ typedef struct _MEMORY_BASIC_INFORMATION
 
 #define UNICODE_STRING_MAX_CHARS 32767
 
-#define FIELD_OFFSET(type, field) \
-  ((LONG)(INT_PTR)&(((type *)0)->field))
+#define FIELD_OFFSET(type, field) offsetof(type, field)
 
 #define CONTAINING_RECORD(address, type, field) \
   ((type *)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
-- 
1.8.0




More information about the wine-patches mailing list