mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-14 18:15:43 +00:00
hostname: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
cc47be73c9
commit
fdc124c1c6
|
@ -1,7 +1,8 @@
|
||||||
MODULE = hostname.exe
|
MODULE = hostname.exe
|
||||||
APPMODE = -mconsole -municode
|
|
||||||
DELAYIMPORTS = user32
|
DELAYIMPORTS = user32
|
||||||
|
|
||||||
|
EXTRADLLFLAGS = -mconsole -municode -mno-cygwin
|
||||||
|
|
||||||
C_SRCS = hostname.c
|
C_SRCS = hostname.c
|
||||||
|
|
||||||
RC_SRCS = hostname.rc
|
RC_SRCS = hostname.rc
|
||||||
|
|
|
@ -20,23 +20,22 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <windef.h>
|
#include <windef.h>
|
||||||
#include <winbase.h>
|
#include <winbase.h>
|
||||||
#include <wincon.h>
|
#include <wincon.h>
|
||||||
#include <winnls.h>
|
#include <winnls.h>
|
||||||
#include <winuser.h>
|
#include <winuser.h>
|
||||||
|
|
||||||
#include <wine/unicode.h>
|
|
||||||
|
|
||||||
#include "hostname.h"
|
#include "hostname.h"
|
||||||
|
|
||||||
static int hostname_vprintfW(const WCHAR *msg, va_list va_args)
|
static int hostname_vprintfW(const WCHAR *msg, __ms_va_list va_args)
|
||||||
{
|
{
|
||||||
int wlen;
|
int wlen;
|
||||||
DWORD count, ret;
|
DWORD count, ret;
|
||||||
WCHAR msg_buffer[8192];
|
WCHAR msg_buffer[8192];
|
||||||
|
|
||||||
wlen = vsprintfW(msg_buffer, msg, va_args);
|
wlen = vswprintf(msg_buffer, ARRAY_SIZE(msg_buffer), msg, va_args);
|
||||||
|
|
||||||
ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), msg_buffer, wlen, &count, NULL);
|
ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), msg_buffer, wlen, &count, NULL);
|
||||||
if (!ret)
|
if (!ret)
|
||||||
|
@ -63,29 +62,29 @@ static int hostname_vprintfW(const WCHAR *msg, va_list va_args)
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hostname_printfW(const WCHAR *msg, ...)
|
static int WINAPIV hostname_printfW(const WCHAR *msg, ...)
|
||||||
{
|
{
|
||||||
va_list va_args;
|
__ms_va_list va_args;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
va_start(va_args, msg);
|
__ms_va_start(va_args, msg);
|
||||||
len = hostname_vprintfW(msg, va_args);
|
len = hostname_vprintfW(msg, va_args);
|
||||||
va_end(va_args);
|
__ms_va_end(va_args);
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hostname_message_printfW(int msg, ...)
|
static int WINAPIV hostname_message_printfW(int msg, ...)
|
||||||
{
|
{
|
||||||
va_list va_args;
|
__ms_va_list va_args;
|
||||||
WCHAR msg_buffer[8192];
|
WCHAR msg_buffer[8192];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
LoadStringW(GetModuleHandleW(NULL), msg, msg_buffer, ARRAY_SIZE(msg_buffer));
|
LoadStringW(GetModuleHandleW(NULL), msg, msg_buffer, ARRAY_SIZE(msg_buffer));
|
||||||
|
|
||||||
va_start(va_args, msg);
|
__ms_va_start(va_args, msg);
|
||||||
len = hostname_vprintfW(msg_buffer, va_args);
|
len = hostname_vprintfW(msg_buffer, va_args);
|
||||||
va_end(va_args);
|
__ms_va_end(va_args);
|
||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
@ -127,7 +126,7 @@ int wmain(int argc, WCHAR *argv[])
|
||||||
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (!strncmpW(argv[1], slashHelpW, ARRAY_SIZE(slashHelpW) - 1))
|
if (!wcsncmp(argv[1], slashHelpW, ARRAY_SIZE(slashHelpW) - 1))
|
||||||
{
|
{
|
||||||
hostname_message(STRING_USAGE);
|
hostname_message(STRING_USAGE);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in a new issue