summaryrefslogtreecommitdiff
path: root/src/win32/windows.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-03-30 00:55:45 -0400
committerAdam <Adam@anope.org>2011-03-30 00:55:45 -0400
commit8098ed899a3648897c0de925c974e21883a76b8d (patch)
treeb46ae9bc84943be1a73ebbb56502250f6afe0de6 /src/win32/windows.cpp
parent77c98f0750da20bc565eb33b9a9d7bbbd1535006 (diff)
Fixed windows build more, including ldap
Diffstat (limited to 'src/win32/windows.cpp')
-rw-r--r--src/win32/windows.cpp16
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