Amine Khaldi : include: Define CONTAINING_RECORD using the standard offsetof.

Alexandre Julliard julliard at winehq.org
Tue Dec 11 14:41:15 CST 2012


Module: wine
Branch: master
Commit: 649c982e60d312e0a539f0c20d6ee4f2ea37ba40
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=649c982e60d312e0a539f0c20d6ee4f2ea37ba40

Author: Amine Khaldi <amine.khaldi at reactos.org>
Date:   Mon Dec 10 23:15:36 2012 +0100

include: Define CONTAINING_RECORD using the standard offsetof.

---

 include/winnt.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/winnt.h b/include/winnt.h
index 5f753bc..467b427 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -749,7 +749,7 @@ typedef struct _MEMORY_BASIC_INFORMATION
 #define FIELD_OFFSET(type, field) ((LONG)offsetof(type, field))
 
 #define CONTAINING_RECORD(address, type, field) \
-  ((type *)((PCHAR)(address) - (PCHAR)(&((type *)0)->field)))
+  ((type *)((PCHAR)(address) - offsetof(type, field)))
 
 /* Types */
 




More information about the wine-cvs mailing list