https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0b21a561cda2909364d7d…
commit 0b21a561cda2909364d7d066aa5e83ca5a754001
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Thu Dec 21 13:45:22 2017 +0100
[DINPUT_WINETEST] Add a PCH.
---
modules/rostests/winetests/dinput/CMakeLists.txt | 6 ++++--
modules/rostests/winetests/dinput/device.c | 13 +------------
modules/rostests/winetests/dinput/dinput.c | 13 +------------
modules/rostests/winetests/dinput/joystick.c | 16 +---------------
modules/rostests/winetests/dinput/keyboard.c | 18 +-----------------
modules/rostests/winetests/dinput/mouse.c | 17 +----------------
modules/rostests/winetests/dinput/precomp.h | 17 +++++++++++++++++
7 files changed, 26 insertions(+), 74 deletions(-)
diff --git a/modules/rostests/winetests/dinput/CMakeLists.txt
b/modules/rostests/winetests/dinput/CMakeLists.txt
index 72cc31fb0d..58bec04925 100644
--- a/modules/rostests/winetests/dinput/CMakeLists.txt
+++ b/modules/rostests/winetests/dinput/CMakeLists.txt
@@ -1,15 +1,17 @@
add_definitions(-DUSE_WINE_TODOS)
-add_executable(dinput_winetest
+list(APPEND SOURCE
device.c
dinput.c
joystick.c
keyboard.c
mouse.c
- testlist.c)
+ precomp.h)
+add_executable(dinput_winetest ${SOURCE} testlist.c)
target_link_libraries(dinput_winetest dinput_data_formats)
set_module_type(dinput_winetest win32cui)
add_importlibs(dinput_winetest dinput ole32 user32 msvcrt kernel32)
+add_pch(dinput_winetest precomp.h SOURCE)
add_rostests_file(TARGET dinput_winetest)
diff --git a/modules/rostests/winetests/dinput/device.c
b/modules/rostests/winetests/dinput/device.c
index 20d211d4e6..605b091480 100644
--- a/modules/rostests/winetests/dinput/device.c
+++ b/modules/rostests/winetests/dinput/device.c
@@ -16,18 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#define DIRECTINPUT_VERSION 0x0700
-
-#define COBJMACROS
-//#include <windows.h>
-
-#include <wine/test.h>
-//#include "windef.h"
-#include <dinput.h>
+#include "precomp.h"
static const DIOBJECTDATAFORMAT obj_data_format[] = {
{ &GUID_YAxis, 16, DIDFT_OPTIONAL|DIDFT_AXIS |DIDFT_MAKEINSTANCE(1), 0},
diff --git a/modules/rostests/winetests/dinput/dinput.c
b/modules/rostests/winetests/dinput/dinput.c
index 54de5d0b73..b4f36402d2 100644
--- a/modules/rostests/winetests/dinput/dinput.c
+++ b/modules/rostests/winetests/dinput/dinput.c
@@ -16,19 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
+#include "precomp.h"
-#define DIRECTINPUT_VERSION 0x0700
-
-#define COBJMACROS
-
-#include <wine/test.h>
-
-#include <initguid.h>
-//#include <windows.h>
-#include <dinput.h>
#include <dinputd.h>
HINSTANCE hInstance;
diff --git a/modules/rostests/winetests/dinput/joystick.c
b/modules/rostests/winetests/dinput/joystick.c
index 28b70bccd7..6649023056 100644
--- a/modules/rostests/winetests/dinput/joystick.c
+++ b/modules/rostests/winetests/dinput/joystick.c
@@ -16,24 +16,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
+#include "precomp.h"
-#define DIRECTINPUT_VERSION 0x0700
-
-#define COBJMACROS
-//#include <windows.h>
-
-//#include <math.h>
#include <stdio.h>
-//#include <stdlib.h>
-
-#include <wine/test.h>
-//#include "windef.h"
-//#include "wingdi.h"
#include <winnls.h>
-#include <dinput.h>
#define numObjects(x) (sizeof(x) / sizeof(x[0]))
diff --git a/modules/rostests/winetests/dinput/keyboard.c
b/modules/rostests/winetests/dinput/keyboard.c
index 18e1f0702d..6df1028a32 100644
--- a/modules/rostests/winetests/dinput/keyboard.c
+++ b/modules/rostests/winetests/dinput/keyboard.c
@@ -16,23 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#define DIRECTINPUT_VERSION 0x0700
-
-#define COBJMACROS
-//#include <windows.h>
-
-//#include <math.h>
-//#include <stdio.h>
-//#include <stdlib.h>
-
-#include <wine/test.h>
-//#include "windef.h"
-//#include "wingdi.h"
-#include <dinput.h>
+#include "precomp.h"
static void acquire_tests(IDirectInputA *pDI, HWND hwnd)
{
diff --git a/modules/rostests/winetests/dinput/mouse.c
b/modules/rostests/winetests/dinput/mouse.c
index 8463c169cb..5c7209ccab 100644
--- a/modules/rostests/winetests/dinput/mouse.c
+++ b/modules/rostests/winetests/dinput/mouse.c
@@ -17,22 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
-#define DIRECTINPUT_VERSION 0x0700
-
-#define COBJMACROS
-//#include <windows.h>
-
-//#include <math.h>
-//#include <stdlib.h>
-
-#include <wine/test.h>
-//#include "windef.h"
-//#include "wingdi.h"
-#include <dinput.h>
+#include "precomp.h"
static const HRESULT SetCoop_null_window[16] = {
E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG,
diff --git a/modules/rostests/winetests/dinput/precomp.h
b/modules/rostests/winetests/dinput/precomp.h
new file mode 100644
index 0000000000..131fdabfe8
--- /dev/null
+++ b/modules/rostests/winetests/dinput/precomp.h
@@ -0,0 +1,17 @@
+#ifndef _DINPUT_WINETEST_PRECOMP_H_
+#define _DINPUT_WINETEST_PRECOMP_H_
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+#define DIRECTINPUT_VERSION 0x0700
+
+#define COBJMACROS
+
+#include <wine/test.h>
+
+#include <initguid.h>
+#include <dinput.h>
+
+#endif /* !_DINPUT_WINETEST_PRECOMP_H_ */