aboutsummaryrefslogtreecommitdiffstats
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
parent7614a4d6840015faa2a163d53bfa8f6553e04f74 (diff)
tools: play nice with mingw/cygwin
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/rtl_adsb.c2
-rw-r--r--src/rtl_eeprom.c2
-rw-r--r--src/rtl_fm.c2
-rw-r--r--src/rtl_power.c2
-rw-r--r--src/rtl_sdr.c2
-rw-r--r--src/rtl_tcp.c6
-rw-r--r--src/rtl_test.c2
8 files changed, 12 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7bca10b..38ac947 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -117,7 +117,7 @@ endif()
if(WIN32)
target_link_libraries(rtl_sdr libgetopt_static)
-target_link_libraries(rtl_tcp libgetopt_static)
+target_link_libraries(rtl_tcp ws2_32 libgetopt_static)
target_link_libraries(rtl_test libgetopt_static)
target_link_libraries(rtl_fm libgetopt_static)
target_link_libraries(rtl_eeprom libgetopt_static)
diff --git a/src/rtl_adsb.c b/src/rtl_adsb.c
index 4a65995..097a6f4 100644
--- a/src/rtl_adsb.c
+++ b/src/rtl_adsb.c
@@ -31,7 +31,7 @@
#ifndef _WIN32
#include <unistd.h>
#else
-#include <Windows.h>
+#include <windows.h>
#include <fcntl.h>
#include <io.h>
#include "getopt/getopt.h"
diff --git a/src/rtl_eeprom.c b/src/rtl_eeprom.c
index 35191de..2b6d0b1 100644
--- a/src/rtl_eeprom.c
+++ b/src/rtl_eeprom.c
@@ -24,7 +24,7 @@
#ifndef _WIN32
#include <unistd.h>
#else
-#include <Windows.h>
+#include <windows.h>
#include "getopt/getopt.h"
#endif
diff --git a/src/rtl_fm.c b/src/rtl_fm.c
index d9c1290..8851f87 100644
--- a/src/rtl_fm.c
+++ b/src/rtl_fm.c
@@ -52,7 +52,7 @@
#ifndef _WIN32
#include <unistd.h>
#else
-#include <Windows.h>
+#include <windows.h>
#include <fcntl.h>
#include <io.h>
#include "getopt/getopt.h"
diff --git a/src/rtl_power.c b/src/rtl_power.c
index f4d132c..e2cb30d 100644
--- a/src/rtl_power.c
+++ b/src/rtl_power.c
@@ -49,7 +49,7 @@
#ifndef _WIN32
#include <unistd.h>
#else
-#include <Windows.h>
+#include <windows.h>
#include <fcntl.h>
#include <io.h>
#include "getopt/getopt.h"
diff --git a/src/rtl_sdr.c b/src/rtl_sdr.c
index eeb6dba..730aa9e 100644
--- a/src/rtl_sdr.c
+++ b/src/rtl_sdr.c
@@ -25,7 +25,7 @@
#ifndef _WIN32
#include <unistd.h>
#else
-#include <Windows.h>
+#include <windows.h>
#include <io.h>
#include <fcntl.h>
#include "getopt/getopt.h"
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);
}
diff --git a/src/rtl_test.c b/src/rtl_test.c
index f5a56b8..4320cf9 100644
--- a/src/rtl_test.c
+++ b/src/rtl_test.c
@@ -32,7 +32,7 @@
#ifndef _WIN32
#include <unistd.h>
#else
-#include <Windows.h>
+#include <windows.h>
#include "getopt/getopt.h"
#endif