From d4ef782db7928e0deed5f0b43a8a1557cae0358e Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 24 Apr 2019 12:10:19 +0200 Subject: [PATCH] makefiles: Build all tests with msvcrt. Signed-off-by: Alexandre Julliard --- dlls/advpack/tests/advpack.c | 8 ++++---- dlls/kernel32/tests/debugger.c | 8 ++++---- dlls/kernel32/tests/process.c | 8 ++++---- dlls/msi/tests/custom.c | 8 ++++---- dlls/msi/tests/db.c | 8 ++++---- dlls/msvcirt/tests/Makefile.in | 1 - dlls/msvcp100/tests/Makefile.in | 1 - dlls/msvcp110/tests/Makefile.in | 1 - dlls/msvcp120/tests/Makefile.in | 1 - dlls/msvcp140/tests/Makefile.in | 1 - dlls/msvcp60/tests/Makefile.in | 1 - dlls/msvcp90/tests/Makefile.in | 1 - dlls/msvcr100/tests/Makefile.in | 1 - dlls/msvcr110/tests/Makefile.in | 1 - dlls/msvcr120/tests/Makefile.in | 1 - dlls/msvcr90/tests/Makefile.in | 1 - dlls/msvcrt/tests/Makefile.in | 1 - dlls/msvcrtd/tests/Makefile.in | 1 - dlls/shell32/tests/shlexec.c | 16 ++++++++-------- dlls/ucrtbase/tests/Makefile.in | 1 - programs/services/tests/service.c | 10 +++++----- tools/makedep.c | 1 + 22 files changed, 34 insertions(+), 47 deletions(-) diff --git a/dlls/advpack/tests/advpack.c b/dlls/advpack/tests/advpack.c index 8d7c5ebb485..5bd39f76fdb 100644 --- a/dlls/advpack/tests/advpack.c +++ b/dlls/advpack/tests/advpack.c @@ -189,14 +189,14 @@ static void delnode_test(void) ok (hr == S_OK, "DelNode failed deleting a directory containing multiple files\n"); } -static void append_str(char **str, const char *data, ...) +static void WINAPIV append_str(char **str, const char *data, ...) { - va_list valist; + __ms_va_list valist; - va_start(valist, data); + __ms_va_start(valist, data); vsprintf(*str, data, valist); *str += strlen(*str); - va_end(valist); + __ms_va_end(valist); } static void create_inf_file(void) diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c index a85fe59e423..f62a614a97c 100644 --- a/dlls/kernel32/tests/debugger.c +++ b/dlls/kernel32/tests/debugger.c @@ -42,13 +42,13 @@ static BOOL (WINAPI *pIsDebuggerPresent)(void); static LONG child_failures; -static void WINETEST_PRINTF_ATTR(2, 3) test_child_ok(int condition, const char *msg, ...) +static void WINAPIV WINETEST_PRINTF_ATTR(2, 3) test_child_ok(int condition, const char *msg, ...) { - va_list valist; + __ms_va_list valist; - va_start(valist, msg); + __ms_va_start(valist, msg); winetest_vok(condition, msg, valist); - va_end(valist); + __ms_va_end(valist); if (!condition) ++child_failures; } diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index f62f8fb0ba1..c593ebe9b0e 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -281,15 +281,15 @@ static void get_file_name(char* buf) * static void childPrintf * */ -static void WINETEST_PRINTF_ATTR(2,3) childPrintf(HANDLE h, const char* fmt, ...) +static void WINAPIV WINETEST_PRINTF_ATTR(2,3) childPrintf(HANDLE h, const char* fmt, ...) { - va_list valist; + __ms_va_list valist; char buffer[1024+4*MAX_LISTED_ENV_VAR]; DWORD w; - va_start(valist, fmt); + __ms_va_start(valist, fmt); vsprintf(buffer, fmt, valist); - va_end(valist); + __ms_va_end(valist); WriteFile(h, buffer, strlen(buffer), &w, NULL); } diff --git a/dlls/msi/tests/custom.c b/dlls/msi/tests/custom.c index 3a189efff68..f994ad4c18a 100644 --- a/dlls/msi/tests/custom.c +++ b/dlls/msi/tests/custom.c @@ -34,15 +34,15 @@ static int todo_level, todo_do_loop; -static void ok_(MSIHANDLE hinst, int todo, const char *file, int line, int condition, const char *msg, ...) +static void WINAPIV ok_(MSIHANDLE hinst, int todo, const char *file, int line, int condition, const char *msg, ...) { static char buffer[2000]; MSIHANDLE record; - va_list valist; + __ms_va_list valist; - va_start(valist, msg); + __ms_va_start(valist, msg); vsprintf(buffer, msg, valist); - va_end(valist); + __ms_va_end(valist); record = MsiCreateRecord(5); MsiRecordSetInteger(record, 1, todo); diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 181301e1fe9..64edcb98c03 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -36,15 +36,15 @@ static const char *mstfile = "winetst-db.mst"; static const WCHAR msifileW[] = {'w','i','n','e','t','e','s','t','-','d','b','.','m','s','i',0}; static const WCHAR msifile2W[] = {'w','i','n','e','t','s','t','2','-','d','b','.','m','s','i',0}; -static void check_record_(int line, MSIHANDLE rec, UINT count, ...) +static void WINAPIV check_record_(int line, MSIHANDLE rec, UINT count, ...) { - va_list args; + __ms_va_list args; UINT i; ok_(__FILE__, line)(count == MsiRecordGetFieldCount(rec), "expected %u fields, got %u\n", count, MsiRecordGetFieldCount(rec)); - va_start(args, count); + __ms_va_start(args, count); for (i = 1; i <= count; ++i) { @@ -57,7 +57,7 @@ static void check_record_(int line, MSIHANDLE rec, UINT count, ...) "field %u: expected \"%s\", got \"%s\"\n", i, expect, buffer); } - va_end(args); + __ms_va_end(args); } #define check_record(rec, ...) check_record_(__LINE__, rec, __VA_ARGS__) diff --git a/dlls/msvcirt/tests/Makefile.in b/dlls/msvcirt/tests/Makefile.in index 17955cfffac..340d2e00996 100644 --- a/dlls/msvcirt/tests/Makefile.in +++ b/dlls/msvcirt/tests/Makefile.in @@ -1,4 +1,3 @@ TESTDLL = msvcirt.dll -APPMODE = -mno-cygwin C_SRCS = msvcirt.c diff --git a/dlls/msvcp100/tests/Makefile.in b/dlls/msvcp100/tests/Makefile.in index 3414a300fd0..8d0a4ef893d 100644 --- a/dlls/msvcp100/tests/Makefile.in +++ b/dlls/msvcp100/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcp100.dll -APPMODE = -mno-cygwin C_SRCS = \ misc.c \ diff --git a/dlls/msvcp110/tests/Makefile.in b/dlls/msvcp110/tests/Makefile.in index 30d02aa894a..e064826b2d2 100644 --- a/dlls/msvcp110/tests/Makefile.in +++ b/dlls/msvcp110/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcp110.dll -APPMODE = -mno-cygwin C_SRCS = \ msvcp110.c diff --git a/dlls/msvcp120/tests/Makefile.in b/dlls/msvcp120/tests/Makefile.in index fc0869951ac..088a2164148 100644 --- a/dlls/msvcp120/tests/Makefile.in +++ b/dlls/msvcp120/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcp120.dll -APPMODE = -mno-cygwin C_SRCS = \ msvcp120.c diff --git a/dlls/msvcp140/tests/Makefile.in b/dlls/msvcp140/tests/Makefile.in index fde164b1a22..aa82d0cba06 100644 --- a/dlls/msvcp140/tests/Makefile.in +++ b/dlls/msvcp140/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcp140.dll -APPMODE = -mno-cygwin C_SRCS = \ msvcp140.c diff --git a/dlls/msvcp60/tests/Makefile.in b/dlls/msvcp60/tests/Makefile.in index 037f00f6b1c..5bc1aaa334a 100644 --- a/dlls/msvcp60/tests/Makefile.in +++ b/dlls/msvcp60/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcp60.dll -APPMODE = -mno-cygwin C_SRCS = \ ios.c \ diff --git a/dlls/msvcp90/tests/Makefile.in b/dlls/msvcp90/tests/Makefile.in index 59bfadac2be..3dfaf0b303e 100644 --- a/dlls/msvcp90/tests/Makefile.in +++ b/dlls/msvcp90/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcp90.dll -APPMODE = -mno-cygwin C_SRCS = \ ios.c \ diff --git a/dlls/msvcr100/tests/Makefile.in b/dlls/msvcr100/tests/Makefile.in index 97480bb6cc3..a7652df38d2 100644 --- a/dlls/msvcr100/tests/Makefile.in +++ b/dlls/msvcr100/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcr100.dll -APPMODE = -mno-cygwin C_SRCS = \ msvcr100.c diff --git a/dlls/msvcr110/tests/Makefile.in b/dlls/msvcr110/tests/Makefile.in index e8fa81889df..e9ece8c1a80 100644 --- a/dlls/msvcr110/tests/Makefile.in +++ b/dlls/msvcr110/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcr110.dll -APPMODE = -mno-cygwin C_SRCS = \ msvcr110.c diff --git a/dlls/msvcr120/tests/Makefile.in b/dlls/msvcr120/tests/Makefile.in index 5a88f38d276..9898cbae117 100644 --- a/dlls/msvcr120/tests/Makefile.in +++ b/dlls/msvcr120/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcr120.dll -APPMODE = -mno-cygwin C_SRCS = \ msvcr120.c diff --git a/dlls/msvcr90/tests/Makefile.in b/dlls/msvcr90/tests/Makefile.in index 172e14626f9..9db8275e020 100644 --- a/dlls/msvcr90/tests/Makefile.in +++ b/dlls/msvcr90/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcr90.dll -APPMODE = -mno-cygwin C_SRCS = \ msvcr90.c diff --git a/dlls/msvcrt/tests/Makefile.in b/dlls/msvcrt/tests/Makefile.in index 0867ac01ffe..da1b55e5a95 100644 --- a/dlls/msvcrt/tests/Makefile.in +++ b/dlls/msvcrt/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcrt.dll -APPMODE = -mno-cygwin EXTRAINCL = -I$(srcdir)/.. IMPORTS = advapi32 diff --git a/dlls/msvcrtd/tests/Makefile.in b/dlls/msvcrtd/tests/Makefile.in index d86815a8239..d72b1d6a16d 100644 --- a/dlls/msvcrtd/tests/Makefile.in +++ b/dlls/msvcrtd/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = msvcrtd.dll -APPMODE = -mno-cygwin C_SRCS = \ debug.c diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index dbf2f88a373..496006985cf 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -117,15 +117,15 @@ static char* decodeA(const char* str) return ptr; } -static void WINETEST_PRINTF_ATTR(2,3) childPrintf(HANDLE h, const char* fmt, ...) +static void WINAPIV WINETEST_PRINTF_ATTR(2,3) childPrintf(HANDLE h, const char* fmt, ...) { - va_list valist; + __ms_va_list valist; char buffer[1024]; DWORD w; - va_start(valist, fmt); + __ms_va_start(valist, fmt); vsprintf(buffer, fmt, valist); - va_end(valist); + __ms_va_end(valist); WriteFile(h, buffer, strlen(buffer), &w, NULL); } @@ -351,16 +351,16 @@ static void dump_child_(const char* file, int line) ***/ static char shell_call[2048]; -static void WINETEST_PRINTF_ATTR(2,3) _okShell(int condition, const char *msg, ...) +static void WINAPIV WINETEST_PRINTF_ATTR(2,3) _okShell(int condition, const char *msg, ...) { - va_list valist; + __ms_va_list valist; char buffer[2048]; strcpy(buffer, shell_call); strcat(buffer, " "); - va_start(valist, msg); + __ms_va_start(valist, msg); vsprintf(buffer+strlen(buffer), msg, valist); - va_end(valist); + __ms_va_end(valist); winetest_ok(condition, "%s", buffer); } #define okShell_(file, line) (winetest_set_location(file, line), 0) ? (void)0 : _okShell diff --git a/dlls/ucrtbase/tests/Makefile.in b/dlls/ucrtbase/tests/Makefile.in index bdd259dcf4f..3fd4b1c7d38 100644 --- a/dlls/ucrtbase/tests/Makefile.in +++ b/dlls/ucrtbase/tests/Makefile.in @@ -1,5 +1,4 @@ TESTDLL = ucrtbase.dll -APPMODE = -mno-cygwin C_SRCS = \ cpp.c \ diff --git a/programs/services/tests/service.c b/programs/services/tests/service.c index 5e9265d587f..f6e36fb6933 100644 --- a/programs/services/tests/service.c +++ b/programs/services/tests/service.c @@ -56,14 +56,14 @@ static inline void service_event(const char *event) send_msg("EVENT", event); } -static void service_ok(int cnd, const char *msg, ...) +static void WINAPIV service_ok(int cnd, const char *msg, ...) { - va_list valist; - char buf[512]; + __ms_va_list valist; + char buf[512]; - va_start(valist, msg); + __ms_va_start(valist, msg); vsprintf(buf, msg, valist); - va_end(valist); + __ms_va_end(valist); send_msg(cnd ? "OK" : "FAIL", buf); } diff --git a/tools/makedep.c b/tools/makedep.c index e4d48ddeb29..a051281c204 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -4029,6 +4029,7 @@ static void load_sources( struct makefile *make ) make->extra_targets = get_expanded_make_var_array( make, "EXTRA_TARGETS" ); if (make->module && strendswith( make->module, ".a" )) make->staticlib = make->module; + if (make->testdll) strarray_add( &make->extradllflags, "-mno-cygwin" ); strarray_addall( &make->extradllflags, get_expanded_make_var_array( make, "APPMODE" )); make->disabled = make->base_dir && strarray_exists( &disabled_dirs, make->base_dir );