Michael Stefaniuc : msvcrt/tests: Don't open code offsetof().
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Nov 27 16:07:41 CST 2014
Module: wine
Branch: master
Commit: 42e6019c009b46dbc0862d43a4a220271ef98786
URL: http://source.winehq.org/git/wine.git/?a=commit;h=42e6019c009b46dbc0862d43a4a220271ef98786
Author: Michael Stefaniuc <mstefani at redhat.de>
Date: Thu Nov 27 11:30:28 2014 +0100
msvcrt/tests: Don't open code offsetof().
---
dlls/msvcrt/tests/headers.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/dlls/msvcrt/tests/headers.c b/dlls/msvcrt/tests/headers.c
index 7c102b4..52d739e 100644
--- a/dlls/msvcrt/tests/headers.c
+++ b/dlls/msvcrt/tests/headers.c
@@ -66,11 +66,10 @@
#define TYPEOF(type) int
#endif
#define MSVCRT(x) MSVCRT_##x
-#define OFFSET(T,F) ((unsigned int)((char *)&((struct T *)0L)->F - (char *)0L))
#define CHECK_SIZE(e) ok(sizeof(e) == sizeof(MSVCRT(e)), "Element has different sizes\n")
#define CHECK_TYPE(t) { TYPEOF(t) a = 0; TYPEOF(MSVCRT(t)) b = a; a = b; CHECK_SIZE(t); }
#define CHECK_STRUCT(s) ok(sizeof(struct s) == sizeof(struct MSVCRT(s)), "Struct has different sizes\n")
-#define CHECK_FIELD(s,e) ok(OFFSET(s,e) == OFFSET(MSVCRT(s),e), "Bad offset\n")
+#define CHECK_FIELD(s,e) ok(offsetof(struct s,e) == offsetof(struct MSVCRT(s),e), "Bad offset\n")
#define CHECK_DEF(d) ok(d == MSVCRT_##d, "Defines (MSVCRT_)" #d " are different: %d vs. %d\n", d, MSVCRT_##d)
/************* Checking types ***************/
More information about the wine-cvs
mailing list