diff options
author | burlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-15 20:41:30 +0000 |
---|---|---|
committer | burlex <burlex@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-08-15 20:41:30 +0000 |
commit | 8cebdce0933438c32fc5821dd16d090ea06fd8cc (patch) | |
tree | 505df2bb898fad59ebd2dfef0a61698c4765c973 /win/inspircd_win32wrapper.cpp | |
parent | bb35a0fa9cbebe51fa636f707c12ca4a7033dd9a (diff) |
* include/caller.h will now compile correctly on Windows platforms.
+ Implemented gettimeofday in win32 wrapper, link rtt's will now display in milliseconds.
* SocketEngine::BoundsCheckFd will now handle Windows event handler cases correctly. (fixing writing to sockets not working)
* Fixed VC71 project.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7723 e03df62e-2008-0410-955e-edbf42e46eb7
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; +} |