server: drop perror redefine (win32)
This commit is contained in:
parent
84b5f742c1
commit
bbb355f08f
@ -145,7 +145,7 @@ void logmsg(const char *msg, ...)
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
/* use instead of perror() on generic Windows */
|
/* use instead of perror() on generic Windows */
|
||||||
void win32_perror(const char *msg)
|
static void win32_perror(const char *msg)
|
||||||
{
|
{
|
||||||
char buf[512];
|
char buf[512];
|
||||||
int err = SOCKERRNO;
|
int err = SOCKERRNO;
|
||||||
@ -176,7 +176,7 @@ int win32_init(void)
|
|||||||
err = WSAStartup(wVersionRequested, &wsaData);
|
err = WSAStartup(wVersionRequested, &wsaData);
|
||||||
|
|
||||||
if(err) {
|
if(err) {
|
||||||
perror("Winsock init failed");
|
win32_perror("Winsock init failed");
|
||||||
logmsg("Error initialising Winsock -- aborting");
|
logmsg("Error initialising Winsock -- aborting");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ int win32_init(void)
|
|||||||
if(LOBYTE(wsaData.wVersion) != LOBYTE(wVersionRequested) ||
|
if(LOBYTE(wsaData.wVersion) != LOBYTE(wVersionRequested) ||
|
||||||
HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested) ) {
|
HIBYTE(wsaData.wVersion) != HIBYTE(wVersionRequested) ) {
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
perror("Winsock init failed");
|
win32_perror("Winsock init failed");
|
||||||
logmsg("No suitable winsock.dll found -- aborting");
|
logmsg("No suitable winsock.dll found -- aborting");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -635,7 +635,7 @@ static unsigned int WINAPI main_window_loop(void *lpParameter)
|
|||||||
wc.hInstance = (HINSTANCE)lpParameter;
|
wc.hInstance = (HINSTANCE)lpParameter;
|
||||||
wc.lpszClassName = TEXT("MainWClass");
|
wc.lpszClassName = TEXT("MainWClass");
|
||||||
if(!RegisterClass(&wc)) {
|
if(!RegisterClass(&wc)) {
|
||||||
perror("RegisterClass failed");
|
win32_perror("RegisterClass failed");
|
||||||
return (DWORD)-1;
|
return (DWORD)-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -647,14 +647,14 @@ static unsigned int WINAPI main_window_loop(void *lpParameter)
|
|||||||
(HWND)NULL, (HMENU)NULL,
|
(HWND)NULL, (HMENU)NULL,
|
||||||
wc.hInstance, (LPVOID)NULL);
|
wc.hInstance, (LPVOID)NULL);
|
||||||
if(!hidden_main_window) {
|
if(!hidden_main_window) {
|
||||||
perror("CreateWindowEx failed");
|
win32_perror("CreateWindowEx failed");
|
||||||
return (DWORD)-1;
|
return (DWORD)-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
ret = GetMessage(&msg, NULL, 0, 0);
|
ret = GetMessage(&msg, NULL, 0, 0);
|
||||||
if(ret == -1) {
|
if(ret == -1) {
|
||||||
perror("GetMessage failed");
|
win32_perror("GetMessage failed");
|
||||||
return (DWORD)-1;
|
return (DWORD)-1;
|
||||||
}
|
}
|
||||||
else if(ret) {
|
else if(ret) {
|
||||||
|
|||||||
@ -54,11 +54,6 @@ extern const char *cmdfile;
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <process.h>
|
#include <process.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#undef perror
|
|
||||||
#define perror(m) win32_perror(m)
|
|
||||||
void win32_perror(const char *msg);
|
|
||||||
|
|
||||||
int win32_init(void);
|
int win32_init(void);
|
||||||
const char *sstrerror(int err);
|
const char *sstrerror(int err);
|
||||||
#else /* _WIN32 */
|
#else /* _WIN32 */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user