X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=win%2Finspircd_win32wrapper.h;h=38754d5df4abf0bac8d5741b109ade9c8cf2c6d0;hb=f2dcf19923c4b60b268899c93b8deb3e6f30c6fe;hp=d60276b88fb5d3d73ab35c9b0882b24533f2287c;hpb=78a6d62732f2f0c2752d9de8729a745413ebe64a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/win/inspircd_win32wrapper.h b/win/inspircd_win32wrapper.h index d60276b88..38754d5df 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 @@ -74,6 +69,9 @@ #include #include +/* Windows defines this already. */ +#undef ERROR + /* strcasecmp is not defined on windows by default */ #define strcasecmp _stricmp #define strncasecmp _strnicmp @@ -92,6 +90,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); } @@ -186,5 +188,17 @@ void ::operator delete(void * ptr); #define DISABLE_WRITEV -#endif +#include +class CWin32Exception : public std::exception +{ +public: + CWin32Exception(); + CWin32Exception(const CWin32Exception& other); + virtual const char* what() const throw(); + DWORD GetErrorCode(); + +private: + char szErrorString[500]; + DWORD dwErrorCode; +};