Alexandre Julliard : winetest: Build with msvcrt.
Alexandre Julliard
julliard at winehq.org
Thu May 2 16:45:07 CDT 2019
Module: wine
Branch: master
Commit: 15c4352f4cf8ba1e54c3b97759f158d51285e747
URL: https://source.winehq.org/git/wine.git/?a=commit;h=15c4352f4cf8ba1e54c3b97759f158d51285e747
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu May 2 09:31:10 2019 +0200
winetest: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/winetest/Makefile.in | 3 ++-
programs/winetest/gui.c | 63 ++++++++++++++++++++++---------------------
programs/winetest/main.c | 3 ---
programs/winetest/send.c | 9 +++----
programs/winetest/util.c | 20 +++++++-------
programs/winetest/winetest.h | 8 +++---
6 files changed, 52 insertions(+), 54 deletions(-)
diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in
index 2719a24..0322e77 100644
--- a/programs/winetest/Makefile.in
+++ b/programs/winetest/Makefile.in
@@ -1,8 +1,9 @@
MODULE = winetest.exe
-APPMODE = -mconsole
IMPORTS = uuid comctl32 version user32 gdi32 advapi32 wsock32
DELAYIMPORTS = ole32
+EXTRADLLFLAGS = -mconsole -mno-cygwin
+
C_SRCS = \
gui.c \
main.c \
diff --git a/programs/winetest/gui.c b/programs/winetest/gui.c
index bda00f3..bf9c3de 100644
--- a/programs/winetest/gui.c
+++ b/programs/winetest/gui.c
@@ -60,7 +60,7 @@ MBdefault (int uType)
/* report (R_STATUS, fmt, ...) */
static int
-textStatus (va_list ap)
+textStatus (__ms_va_list ap)
{
char *str = vstrmake (NULL, ap);
@@ -71,7 +71,7 @@ textStatus (va_list ap)
}
static int
-guiStatus (va_list ap)
+guiStatus (__ms_va_list ap)
{
size_t len;
char *str = vstrmake (&len, ap);
@@ -84,7 +84,7 @@ guiStatus (va_list ap)
/* report (R_PROGRESS, barnum, steps) */
static int
-textProgress (va_list ap)
+textProgress (__ms_va_list ap)
{
progressGroup = va_arg (ap, int);
progressMax = va_arg (ap, int);
@@ -93,7 +93,7 @@ textProgress (va_list ap)
}
static int
-guiProgress (va_list ap)
+guiProgress (__ms_va_list ap)
{
unsigned int max;
HWND pb;
@@ -114,7 +114,7 @@ guiProgress (va_list ap)
/* report (R_STEP, fmt, ...) */
static int
-textStep (va_list ap)
+textStep (__ms_va_list ap)
{
char *str = vstrmake (NULL, ap);
@@ -126,7 +126,7 @@ textStep (va_list ap)
}
static int
-guiStep (va_list ap)
+guiStep (__ms_va_list ap)
{
const int pgID = IDC_ST0 + progressGroup * 2;
char *str = vstrmake (NULL, ap);
@@ -141,7 +141,7 @@ guiStep (va_list ap)
/* report (R_DELTA, inc, fmt, ...) */
static int
-textDelta (va_list ap)
+textDelta (__ms_va_list ap)
{
const int inc = va_arg (ap, int);
char *str = vstrmake (NULL, ap);
@@ -154,7 +154,7 @@ textDelta (va_list ap)
}
static int
-guiDelta (va_list ap)
+guiDelta (__ms_va_list ap)
{
const int inc = va_arg (ap, int);
const int pgID = IDC_ST0 + progressGroup * 2;
@@ -170,7 +170,7 @@ guiDelta (va_list ap)
/* report (R_TAG) */
static int
-textTag (va_list ap)
+textTag (__ms_va_list ap)
{
fputs ("Tag: ", stderr);
fputs (tag, stderr);
@@ -179,7 +179,7 @@ textTag (va_list ap)
}
static int
-guiTag (va_list ap)
+guiTag (__ms_va_list ap)
{
SetDlgItemTextA (dialog, IDC_TAG, tag);
return 0;
@@ -187,7 +187,7 @@ guiTag (va_list ap)
/* report (R_DIR, fmt, ...) */
static int
-textDir (va_list ap)
+textDir (__ms_va_list ap)
{
char *str = vstrmake (NULL, ap);
@@ -199,7 +199,7 @@ textDir (va_list ap)
}
static int
-guiDir (va_list ap)
+guiDir (__ms_va_list ap)
{
char *str = vstrmake (NULL, ap);
@@ -210,7 +210,7 @@ guiDir (va_list ap)
/* report (R_OUT, fmt, ...) */
static int
-textOut (va_list ap)
+textOut (__ms_va_list ap)
{
char *str = vstrmake (NULL, ap);
@@ -222,7 +222,7 @@ textOut (va_list ap)
}
static int
-guiOut (va_list ap)
+guiOut (__ms_va_list ap)
{
char *str = vstrmake (NULL, ap);
@@ -233,7 +233,7 @@ guiOut (va_list ap)
/* report (R_WARNING, fmt, ...) */
static int
-textWarning (va_list ap)
+textWarning (__ms_va_list ap)
{
fputs ("Warning: ", stderr);
textStatus (ap);
@@ -241,7 +241,7 @@ textWarning (va_list ap)
}
static int
-guiWarning (va_list ap)
+guiWarning (__ms_va_list ap)
{
char *str = vstrmake (NULL, ap);
@@ -252,7 +252,7 @@ guiWarning (va_list ap)
/* report (R_ERROR, fmt, ...) */
static int
-textError (va_list ap)
+textError (__ms_va_list ap)
{
fputs ("Error: ", stderr);
textStatus (ap);
@@ -260,7 +260,7 @@ textError (va_list ap)
}
static int
-guiError (va_list ap)
+guiError (__ms_va_list ap)
{
char *str = vstrmake (NULL, ap);
@@ -271,22 +271,24 @@ guiError (va_list ap)
/* report (R_FATAL, fmt, ...) */
static int
-textFatal (va_list ap)
+textFatal (__ms_va_list ap)
{
textError (ap);
exit (1);
+ return 0;
}
static int
-guiFatal (va_list ap)
+guiFatal (__ms_va_list ap)
{
guiError (ap);
exit (1);
+ return 0;
}
/* report (R_ASK, type, fmt, ...) */
static int
-textAsk (va_list ap)
+textAsk (__ms_va_list ap)
{
int uType = va_arg (ap, int);
int ret = MBdefault (uType);
@@ -299,7 +301,7 @@ textAsk (va_list ap)
}
static int
-guiAsk (va_list ap)
+guiAsk (__ms_va_list ap)
{
int uType = va_arg (ap, int);
char *str = vstrmake (NULL, ap);
@@ -393,13 +395,13 @@ guiAskEmail (void)
/* Quiet functions */
static int
-qNoOp (va_list ap)
+qNoOp (__ms_va_list ap)
{
return 0;
}
static int
-qAsk (va_list ap)
+qAsk (__ms_va_list ap)
{
return MBdefault (va_arg (ap, int));
}
@@ -476,12 +478,11 @@ DlgThreadProc (LPVOID param)
return 0;
}
-int
-report (enum report_type t, ...)
+int WINAPIV report (enum report_type t, ...)
{
- typedef int r_fun_t (va_list);
+ typedef int r_fun_t (__ms_va_list);
- va_list ap;
+ __ms_va_list ap;
int ret = 0;
static r_fun_t * const text_funcs[] =
{textStatus, textProgress, textStep, textDelta,
@@ -545,10 +546,10 @@ report (enum report_type t, ...)
}
}
}
-
- va_start (ap, t);
+
+ __ms_va_start (ap, t);
if (t < ARRAY_SIZE(text_funcs)) ret = funcs[t](ap);
else report (R_WARNING, "unimplemented report type: %d", t);
- va_end (ap);
+ __ms_va_end (ap);
return ret;
}
diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index ec2f6a7..a6874c2 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -25,9 +25,6 @@
*
*/
-#include "config.h"
-#include "wine/port.h"
-
#define COBJMACROS
#include <stdio.h>
#include <assert.h>
diff --git a/programs/winetest/send.c b/programs/winetest/send.c
index 1b0b94a..1d4e3a7 100644
--- a/programs/winetest/send.c
+++ b/programs/winetest/send.c
@@ -103,17 +103,16 @@ send_buf (SOCKET s, const char *buf, size_t length)
return 0;
}
-static int
-send_str (SOCKET s, ...)
+static int WINAPIV send_str (SOCKET s, ...)
{
- va_list ap;
+ __ms_va_list ap;
char *p;
int ret;
size_t len;
- va_start (ap, s);
+ __ms_va_start (ap, s);
p = vstrmake (&len, ap);
- va_end (ap);
+ __ms_va_end (ap);
if (!p) return 1;
ret = send_buf (s, p, len);
heap_free (p);
diff --git a/programs/winetest/util.c b/programs/winetest/util.c
index af625e7..b3d112e 100644
--- a/programs/winetest/util.c
+++ b/programs/winetest/util.c
@@ -57,7 +57,7 @@ void heap_free (void *op)
HeapFree(GetProcessHeap(), 0, op);
}
-static char *vstrfmtmake (size_t *lenp, const char *fmt, va_list ap)
+static char *vstrfmtmake (size_t *lenp, const char *fmt, __ms_va_list ap)
{
size_t size = 1000;
char *p, *q;
@@ -81,7 +81,7 @@ static char *vstrfmtmake (size_t *lenp, const char *fmt, va_list ap)
return p;
}
-char *vstrmake (size_t *lenp, va_list ap)
+char *vstrmake (size_t *lenp, __ms_va_list ap)
{
const char *fmt;
@@ -89,29 +89,29 @@ char *vstrmake (size_t *lenp, va_list ap)
return vstrfmtmake (lenp, fmt, ap);
}
-char *strmake (size_t *lenp, ...)
+char * WINAPIV strmake (size_t *lenp, ...)
{
- va_list ap;
+ __ms_va_list ap;
char *p;
- va_start (ap, lenp);
+ __ms_va_start (ap, lenp);
p = vstrmake (lenp, ap);
if (!p) report (R_FATAL, "Out of memory.");
- va_end (ap);
+ __ms_va_end (ap);
return p;
}
-void xprintf (const char *fmt, ...)
+void WINAPIV xprintf (const char *fmt, ...)
{
- va_list ap;
+ __ms_va_list ap;
size_t size;
DWORD written;
char *buffer, *head;
- va_start (ap, fmt);
+ __ms_va_start (ap, fmt);
buffer = vstrfmtmake (&size, fmt, ap);
head = buffer;
- va_end (ap);
+ __ms_va_end (ap);
while (size) {
if (!WriteFile( logfile, head, size, &written, NULL ))
report (R_FATAL, "Can't write logs: %u", GetLastError());
diff --git a/programs/winetest/winetest.h b/programs/winetest/winetest.h
index 0446ad5..32d3f90 100644
--- a/programs/winetest/winetest.h
+++ b/programs/winetest/winetest.h
@@ -28,9 +28,9 @@
void fatal (const char* msg);
void warning (const char* msg);
-void xprintf (const char *fmt, ...);
-char *vstrmake (size_t *lenp, va_list ap);
-char *strmake (size_t *lenp, ...);
+void WINAPIV xprintf (const char *fmt, ...);
+char *vstrmake (size_t *lenp, __ms_va_list ap);
+char * WINAPIV strmake (size_t *lenp, ...);
int goodtagchar (char c);
const char *findbadtagchar (const char *tag);
@@ -72,6 +72,6 @@ extern char *email;
extern BOOL aborting;
int guiAskTag (void);
int guiAskEmail (void);
-int report (enum report_type t, ...);
+int WINAPIV report (enum report_type t, ...);
#endif /* __WINETESTS_H */
More information about the wine-cvs
mailing list