X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=win%2Finspircd_win32wrapper.h;h=a7f2b4354ce3c3abf03cae8c2939b701de4484c0;hb=5a366d8945e1312190d0012eb36d2facaa908650;hp=75404ef8b29e170fb10230c61ae9621bbd19a97e;hpb=25aa23067133fa80df009c2245742b3b7749c2e5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h index 75404ef8b..a7f2b4354 100644 --- a/win/inspircd_win32wrapper.h +++ b/win/inspircd_win32wrapper.h @@ -19,13 +19,11 @@ */ +#pragma once + /* Windows Port Wrapper Functions/Definitions By Burlex */ - -#ifndef INSPIRCD_WIN32WRAPPER_H -#define INSPIRCD_WIN32WRAPPER_H - /* * Starting with PSAPI version 2 for Windows 7 and Windows Server 2008 R2, this function is defined as K32GetProcessMemoryInfo in Psapi.h and exported * in Kernel32.lib and Kernel32.dll. However, you should always call this function as GetProcessMemoryInfo. To ensure correct resolution of symbols @@ -45,9 +43,6 @@ #define VC_EXTRALEAN #define WIN32_LEAN_AND_MEAN -/* They just have to be *different*, don't they. */ -#define PATH_MAX MAX_PATH - /* Macros for exporting symbols - dependant on what is being compiled */ #ifdef DLL_BUILD @@ -73,6 +68,15 @@ #include #include #include +#include + +#define F_OK 0 /* test for existence of file */ +#define X_OK (1<<0) /* test for execute or search permission */ +#define W_OK (1<<1) /* test for write permission */ +#define R_OK (1<<2) /* test for read permission */ + +/* Windows defines this already. */ +#undef ERROR /* strcasecmp is not defined on windows by default */ #define strcasecmp _stricmp @@ -92,6 +96,10 @@ CoreExport const char * insp_inet_ntop(int af, const void * src, char * dst, soc #define snprintf _snprintf #define vsnprintf _vsnprintf +#ifndef va_copy +#define va_copy(dest, src) (dest = src) +#endif + /* Unix-style sleep (argument is in seconds) */ __inline void sleep(int seconds) { Sleep(seconds * 1000); } @@ -99,6 +107,9 @@ __inline void sleep(int seconds) { Sleep(seconds * 1000); } #define popen _popen #define pclose _pclose +/* _access */ +#define access _access + /* IPV4 only convert string to address struct */ __inline int inet_aton(const char *cp, struct in_addr *addr) { @@ -201,5 +212,5 @@ private: DWORD dwErrorCode; }; -#endif - +// Same value as EXIT_STATUS_FORK (EXIT_STATUS_FORK is unused on Windows) +#define EXIT_STATUS_SERVICE 4