*/
+#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
#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
#include <direct.h>
#include <process.h>
+/* Windows defines this already. */
+#undef ERROR
+
/* strcasecmp is not defined on windows by default */
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
return (addr->s_addr == INADDR_NONE) ? 0 : 1;
};
-/* Handles colors in printf */
-int printf_c(const char * format, ...);
-
/* getopt() wrapper */
#define no_argument 0
#define required_argument 1
#define DISABLE_WRITEV
-#endif
+#include <exception>
+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;
+};