diff options
Diffstat (limited to 'src/win32/windows.cpp')
-rw-r--r-- | src/win32/windows.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/win32/windows.cpp b/src/win32/windows.cpp index a443472f9..b57171dec 100644 --- a/src/win32/windows.cpp +++ b/src/win32/windows.cpp @@ -123,4 +123,20 @@ const char *inet_ntop(int af, const void *src, char *dst, size_t size) return NULL; } +/** Like gettimeofday(), but it works on Windows. + * @param tv A timeval struct + * @param tz Should be NULL, it is not used + * @return 0 on success + */ +int gettimeofday(timeval *tv, char *) +{ + SYSTEMTIME st; + GetSystemTime(&st); + + tv->tv_sec = Anope::CurTime; + tv->tv_usec = st.wMilliseconds; + + return 0; +} + #endif |