diff options
Diffstat (limited to 'win/inspircd_win32wrapper.cpp')
-rw-r--r-- | win/inspircd_win32wrapper.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/win/inspircd_win32wrapper.cpp b/win/inspircd_win32wrapper.cpp index 1646e39af..e6f25df18 100644 --- a/win/inspircd_win32wrapper.cpp +++ b/win/inspircd_win32wrapper.cpp @@ -17,12 +17,15 @@ #include <string> #include <errno.h> #include <assert.h> +#pragma comment(lib, "winmm.lib") using namespace std; #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff #endif +#include <mmsystem.h> + /* This MUST remain static and delcared outside the class, so that WriteProcessMemory can reference it properly */ static DWORD owner_processid = 0; @@ -640,3 +643,14 @@ bool ValidateWindowsDnsServer(ServerConfig* conf, const char* tag, const char* v } return true; } + +int gettimeofday(struct timeval * tv, void * tz) +{ + if(tv == NULL) + return -1; + + DWORD mstime = timeGetTime(); + tv->tv_sec = time(NULL); + tv->tv_usec = (mstime - (tv->tv_sec * 1000)) * 1000; + return 0; +} |