aboutsummaryrefslogtreecommitdiffstats
path: root/src/rtl_tcp.c
diff options
context:
space:
mode:
authorHoernchen <la@tfc-server.de>2013-10-25 01:11:44 +0200
committerHoernchen <la@tfc-server.de>2013-10-25 01:11:44 +0200
commitdbede4e3c0a9b4b6e60e9b323bf75ee5aec9eb2b (patch)
tree7946e67f71b8357952543449a87f62a108ca6763 /src/rtl_tcp.c
parent7614a4d6840015faa2a163d53bfa8f6553e04f74 (diff)
tools: play nice with mingw/cygwin
Diffstat (limited to 'src/rtl_tcp.c')
-rw-r--r--src/rtl_tcp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c
index 5e44935..8b6431e 100644
--- a/src/rtl_tcp.c
+++ b/src/rtl_tcp.c
@@ -33,7 +33,7 @@
#include <netinet/in.h>
#include <fcntl.h>
#else
-#include <WinSock2.h>
+#include <winsock2.h>
#include "getopt/getopt.h"
#endif
@@ -109,7 +109,11 @@ int gettimeofday(struct timeval *tv, void* ignored)
tmp <<= 32;
tmp |= ft.dwLowDateTime;
tmp /= 10;
+#ifdef _MSC_VER
tmp -= 11644473600000000Ui64;
+#else
+ tmp -= 11644473600000000ULL;
+#endif
tv->tv_sec = (long)(tmp / 1000000UL);
tv->tv_usec = (long)(tmp % 1000000UL);
}