PATCH: dlls/user/tests/input.c

Sami Aario sami.aario at surfeu.fi
Wed Nov 12 15:44:51 CST 2003


Eventually the UNION_MEMBER macro definition should probably be
moved somewhere else.

Name: Sami Aario
ChangeLog:
Removed unnecessary #defines.
Added conditionally compiled UNION_MEMBER macro to take care of
nameless union member incompatibility with gcc and Visual C++ 6.0. Now
compiles with both.

Index: input.c
===================================================================
RCS file: /home/wine/wine/dlls/user/tests/input.c,v
retrieving revision 1.2
diff -u -r1.2 input.c
--- input.c 28 Oct 2003 21:45:31 -0000 1.2
+++ input.c 12 Nov 2003 21:23:08 -0000
@@ -47,14 +47,18 @@
/* for definitions of INPUT */
#define _WIN32_WINNT 0x401
-#define NONAMELESSUNION
-#define NONAMELESSSTRUCT
#include "wine/test.h"
#include "winbase.h"
#include "winuser.h"
#include <assert.h>
+#ifdef NONAMELESSUNION
+#define UNION_MEMBER(x) DUMMYUNIONNAME.x
+#else
+#define UNION_MEMBER(x) x
+#endif
+
/* globals */
HWND hWndTest;
long timetag = 0x10000000;
@@ -81,11 +85,11 @@
#define ADDTOINPUTS(kev) \
inputs[evtctr].type = INPUT_KEYBOARD; \
- inputs[evtctr].u.ki.wVk = GETVKEY[ kev]; \
- inputs[evtctr].u.ki.wScan = GETSCAN[ kev]; \
- inputs[evtctr].u.ki.dwFlags = GETUPDOWN[ kev]; \
- inputs[evtctr].u.ki.dwExtraInfo = 0; \
- inputs[evtctr].u.ki.time = ++timetag; \
+ inputs[evtctr].UNION_MEMBER(ki).wVk = GETVKEY[ kev]; \
+ inputs[evtctr].UNION_MEMBER(ki).wScan = GETSCAN[ kev]; \
+ inputs[evtctr].UNION_MEMBER(ki).dwFlags = GETUPDOWN[ kev]; \
+ inputs[evtctr].UNION_MEMBER(ki).dwExtraInfo = 0; \
+ inputs[evtctr].UNION_MEMBER(ki).time = ++timetag; \
if( kev) evtctr++;
typedef struct {



More information about the wine-patches mailing list