https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9cfa608dcffce7c319dc4…
commit 9cfa608dcffce7c319dc4371b8513bde727c538e
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Wed Dec 20 12:57:58 2017 +0100
[MSVCRT_WINETEST] Add a PCH.
---
modules/rostests/winetests/msvcrt/CMakeLists.txt | 7 ++---
modules/rostests/winetests/msvcrt/cpp.c | 5 ++--
modules/rostests/winetests/msvcrt/data.c | 14 ++--------
modules/rostests/winetests/msvcrt/dir.c | 14 ++--------
modules/rostests/winetests/msvcrt/environ.c | 3 +--
modules/rostests/winetests/msvcrt/file.c | 13 ++-------
modules/rostests/winetests/msvcrt/headers.c | 34 +-----------------------
modules/rostests/winetests/msvcrt/heap.c | 5 ++--
modules/rostests/winetests/msvcrt/locale.c | 5 +---
modules/rostests/winetests/msvcrt/misc.c | 6 ++---
modules/rostests/winetests/msvcrt/precomp.h | 16 +++++++++++
modules/rostests/winetests/msvcrt/printf.c | 11 +-------
modules/rostests/winetests/msvcrt/scanf.c | 4 +--
modules/rostests/winetests/msvcrt/signal.c | 4 +--
modules/rostests/winetests/msvcrt/string.c | 14 ++--------
modules/rostests/winetests/msvcrt/time.c | 12 +++------
16 files changed, 44 insertions(+), 123 deletions(-)
diff --git a/modules/rostests/winetests/msvcrt/CMakeLists.txt
b/modules/rostests/winetests/msvcrt/CMakeLists.txt
index 5aba4c2f7f..f50ed55eae 100644
--- a/modules/rostests/winetests/msvcrt/CMakeLists.txt
+++ b/modules/rostests/winetests/msvcrt/CMakeLists.txt
@@ -18,10 +18,10 @@ list(APPEND SOURCE
scanf.c
signal.c
string.c
- testlist.c
- time.c)
+ time.c
+ precomp.h)
-add_executable(msvcrt_winetest ${SOURCE})
+add_executable(msvcrt_winetest ${SOURCE} testlist.c)
if(USE_CLANG_CL OR (NOT MSVC))
add_target_compile_flags(msvcrt_winetest "-Wno-format")
@@ -35,4 +35,5 @@ if(MSVC)
add_importlibs(msvcrt_winetest ntdll)
endif()
+add_pch(msvcrt_winetest precomp.h SOURCE)
add_rostests_file(TARGET msvcrt_winetest)
diff --git a/modules/rostests/winetests/msvcrt/cpp.c
b/modules/rostests/winetests/msvcrt/cpp.c
index cf5e4c7d60..22f59124e3 100644
--- a/modules/rostests/winetests/msvcrt/cpp.c
+++ b/modules/rostests/winetests/msvcrt/cpp.c
@@ -16,9 +16,8 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "wine/test.h"
-#include "winbase.h"
-#include "winnt.h"
+
+#include "precomp.h"
typedef void (*vtable_ptr)(void);
diff --git a/modules/rostests/winetests/msvcrt/data.c
b/modules/rostests/winetests/msvcrt/data.c
index 9aacac7b50..724eb67c9b 100644
--- a/modules/rostests/winetests/msvcrt/data.c
+++ b/modules/rostests/winetests/msvcrt/data.c
@@ -18,18 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "wine/test.h"
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <io.h>
-#include <windef.h>
-#include <winbase.h>
-#include <winnls.h>
-#include <process.h>
-#include <errno.h>
+#include "precomp.h"
+
#include <direct.h>
void __cdecl __getmainargs(int *, char ***, char ***, int, int *);
diff --git a/modules/rostests/winetests/msvcrt/dir.c
b/modules/rostests/winetests/msvcrt/dir.c
index aa273ea85e..ad96ae70b9 100644
--- a/modules/rostests/winetests/msvcrt/dir.c
+++ b/modules/rostests/winetests/msvcrt/dir.c
@@ -18,19 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "wine/test.h"
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <io.h>
+#include "precomp.h"
+
#include <mbctype.h>
-#include <windef.h>
-#include <winbase.h>
-#include <winnls.h>
-#include <process.h>
-#include <errno.h>
static int (__cdecl *p_makepath_s)(char *, size_t, const char *, const char *, const char
*, const char *);
static int (__cdecl *p_wmakepath_s)(wchar_t *, size_t, const wchar_t *,const wchar_t *,
const wchar_t *, const wchar_t *);
diff --git a/modules/rostests/winetests/msvcrt/environ.c
b/modules/rostests/winetests/msvcrt/environ.c
index fdfe81f5ee..d74922fbba 100644
--- a/modules/rostests/winetests/msvcrt/environ.c
+++ b/modules/rostests/winetests/msvcrt/environ.c
@@ -18,8 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "wine/test.h"
-#include <stdlib.h>
+#include "precomp.h"
static const char *a_very_long_env_string =
"LIBRARY_PATH="
diff --git a/modules/rostests/winetests/msvcrt/file.c
b/modules/rostests/winetests/msvcrt/file.c
index d92a6e459a..b2d32a7c1f 100644
--- a/modules/rostests/winetests/msvcrt/file.c
+++ b/modules/rostests/winetests/msvcrt/file.c
@@ -19,21 +19,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "wine/test.h"
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include "precomp.h"
+
#include <fcntl.h>
#include <share.h>
#include <sys/stat.h>
#include <io.h>
-#include <direct.h>
-#include <windef.h>
-#include <winbase.h>
-#include <winnls.h>
-#include <process.h>
-#include <errno.h>
-#include <locale.h>
#define MSVCRT_FD_BLOCK_SIZE 32
typedef struct {
diff --git a/modules/rostests/winetests/msvcrt/headers.c
b/modules/rostests/winetests/msvcrt/headers.c
index 52d739e107..6a5660f7d8 100644
--- a/modules/rostests/winetests/msvcrt/headers.c
+++ b/modules/rostests/winetests/msvcrt/headers.c
@@ -20,39 +20,7 @@
* symbols defined in msvcrt.h (prefixed by MSVCRT_).
*/
-#include "dos.h"
-#include "math.h"
-#include "stdlib.h"
-#include "io.h"
-#include "errno.h"
-#include "fcntl.h"
-#include "malloc.h"
-#include "limits.h"
-#include "mbctype.h"
-#include "stdio.h"
-#include "wchar.h"
-#include "ctype.h"
-#include "crtdbg.h"
-#include "share.h"
-#include "search.h"
-#include "wctype.h"
-#include "float.h"
-#include "stddef.h"
-#include "mbstring.h"
-#include "sys/locking.h"
-#include "sys/utime.h"
-#include "sys/types.h"
-#include "sys/stat.h"
-#include "sys/timeb.h"
-#include "direct.h"
-#include "conio.h"
-#include "process.h"
-#include "string.h"
-#include "signal.h"
-#include "time.h"
-#include "locale.h"
-#include "setjmp.h"
-#include "wine/test.h"
+#include "precomp.h"
#ifdef __WINE_USE_MSVCRT
/* Wine-specific msvcrt headers */
diff --git a/modules/rostests/winetests/msvcrt/heap.c
b/modules/rostests/winetests/msvcrt/heap.c
index 4a3c7a8170..e7fa3ecf13 100644
--- a/modules/rostests/winetests/msvcrt/heap.c
+++ b/modules/rostests/winetests/msvcrt/heap.c
@@ -18,10 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdlib.h>
+#include "precomp.h"
+
#include <malloc.h>
-#include <errno.h>
-#include "wine/test.h"
static void (__cdecl *p_aligned_free)(void*) = NULL;
static void * (__cdecl *p_aligned_malloc)(size_t,size_t) = NULL;
diff --git a/modules/rostests/winetests/msvcrt/locale.c
b/modules/rostests/winetests/msvcrt/locale.c
index 89761dd947..0554270f1d 100644
--- a/modules/rostests/winetests/msvcrt/locale.c
+++ b/modules/rostests/winetests/msvcrt/locale.c
@@ -18,10 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <locale.h>
-
-#include "wine/test.h"
-#include "winnls.h"
+#include "precomp.h"
static BOOL (__cdecl *p__crtGetStringTypeW)(DWORD, DWORD, const wchar_t*, int, WORD*);
static int (__cdecl *pmemcpy_s)(void *, size_t, void*, size_t);
diff --git a/modules/rostests/winetests/msvcrt/misc.c
b/modules/rostests/winetests/msvcrt/misc.c
index 2aeff43daa..d64cfe86cc 100644
--- a/modules/rostests/winetests/msvcrt/misc.c
+++ b/modules/rostests/winetests/msvcrt/misc.c
@@ -18,11 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <wine/test.h>
-#include <errno.h>
-#include <stdio.h>
+#include "precomp.h"
+
#include <msvcrt.h>
-#include <process.h>
static inline float __port_infinity(void)
{
diff --git a/modules/rostests/winetests/msvcrt/precomp.h
b/modules/rostests/winetests/msvcrt/precomp.h
new file mode 100644
index 0000000000..6cc0b62bc3
--- /dev/null
+++ b/modules/rostests/winetests/msvcrt/precomp.h
@@ -0,0 +1,16 @@
+#ifndef _MSVCRT_WINETEST_PRECOMP_H_
+#define _MSVCRT_WINETEST_PRECOMP_H_
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+#define _CRT_NON_CONFORMING_SWPRINTFS
+
+#include <wine/test.h>
+
+#include <stdio.h>
+#include <winnls.h>
+#include <process.h>
+#include <locale.h>
+
+#endif /* !_MSVCRT_WINETEST_PRECOMP_H_ */
diff --git a/modules/rostests/winetests/msvcrt/printf.c
b/modules/rostests/winetests/msvcrt/printf.c
index f9b3fc9ff0..372509088c 100644
--- a/modules/rostests/winetests/msvcrt/printf.c
+++ b/modules/rostests/winetests/msvcrt/printf.c
@@ -23,17 +23,8 @@
/* With Visual Studio >= 2005, swprintf() takes an extra parameter unless
* the following macro is defined.
*/
-#define _CRT_NON_CONFORMING_SWPRINTFS
-
-#include <stdio.h>
-#include <errno.h>
-#include <locale.h>
-#include "windef.h"
-#include "winbase.h"
-#include "winnls.h"
-
-#include "wine/test.h"
+#include "precomp.h"
static inline float __port_infinity(void)
{
diff --git a/modules/rostests/winetests/msvcrt/scanf.c
b/modules/rostests/winetests/msvcrt/scanf.c
index 1d1f28eaf4..a5c4d9da71 100644
--- a/modules/rostests/winetests/msvcrt/scanf.c
+++ b/modules/rostests/winetests/msvcrt/scanf.c
@@ -18,9 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <stdio.h>
-
-#include "wine/test.h"
+#include "precomp.h"
static void test_sscanf( void )
{
diff --git a/modules/rostests/winetests/msvcrt/signal.c
b/modules/rostests/winetests/msvcrt/signal.c
index ad6ea6ecf9..5947889841 100644
--- a/modules/rostests/winetests/msvcrt/signal.c
+++ b/modules/rostests/winetests/msvcrt/signal.c
@@ -18,8 +18,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "wine/test.h"
-#include <winbase.h>
+#include "precomp.h"
+
#include <signal.h>
static int test_value = 0;
diff --git a/modules/rostests/winetests/msvcrt/string.c
b/modules/rostests/winetests/msvcrt/string.c
index 1681001a86..10974e5ad4 100644
--- a/modules/rostests/winetests/msvcrt/string.c
+++ b/modules/rostests/winetests/msvcrt/string.c
@@ -18,23 +18,13 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "wine/test.h"
-#include <string.h>
+#include "precomp.h"
+
#include <mbstring.h>
#include <wchar.h>
-#include <stdlib.h>
-#include <stdio.h>
#include <mbctype.h>
-#include <locale.h>
-#include <errno.h>
-#include <limits.h>
#include <math.h>
-/* make it use a definition from string.h */
-#undef strncpy
-#include "winbase.h"
-#include "winnls.h"
-
static char *buf_to_string(const unsigned char *bin, int len, int nr)
{
static char buf[2][1024];
diff --git a/modules/rostests/winetests/msvcrt/time.c
b/modules/rostests/winetests/msvcrt/time.c
index 6865e3d269..6173cf4bc6 100644
--- a/modules/rostests/winetests/msvcrt/time.c
+++ b/modules/rostests/winetests/msvcrt/time.c
@@ -18,15 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "wine/test.h"
-#include "winbase.h"
-#include "winnls.h"
-#include "time.h"
-
-#include <stdlib.h> /*setenv*/
-#include <stdio.h> /*printf*/
-#include <locale.h>
-#include <errno.h>
+#include "precomp.h"
+
+#include <time.h>
#define _MAX__TIME64_T (((__time64_t)0x00000007 << 32) | 0x93406FFF)