Browse Source

tools: play nice with mingw/cygwin

Hoernchen 11 years ago
parent
commit
dbede4e3c0
8 changed files with 12 additions and 8 deletions
  1. 1 1
      src/CMakeLists.txt
  2. 1 1
      src/rtl_adsb.c
  3. 1 1
      src/rtl_eeprom.c
  4. 1 1
      src/rtl_fm.c
  5. 1 1
      src/rtl_power.c
  6. 1 1
      src/rtl_sdr.c
  7. 5 1
      src/rtl_tcp.c
  8. 1 1
      src/rtl_test.c

+ 1 - 1
src/CMakeLists.txt

@@ -117,7 +117,7 @@ endif()
 
 
 if(WIN32)
 if(WIN32)
 target_link_libraries(rtl_sdr libgetopt_static)
 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_test libgetopt_static)
 target_link_libraries(rtl_fm libgetopt_static)
 target_link_libraries(rtl_fm libgetopt_static)
 target_link_libraries(rtl_eeprom libgetopt_static)
 target_link_libraries(rtl_eeprom libgetopt_static)

+ 1 - 1
src/rtl_adsb.c

@@ -31,7 +31,7 @@
 #ifndef _WIN32
 #ifndef _WIN32
 #include <unistd.h>
 #include <unistd.h>
 #else
 #else
-#include <Windows.h>
+#include <windows.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #include <io.h>
 #include <io.h>
 #include "getopt/getopt.h"
 #include "getopt/getopt.h"

+ 1 - 1
src/rtl_eeprom.c

@@ -24,7 +24,7 @@
 #ifndef _WIN32
 #ifndef _WIN32
 #include <unistd.h>
 #include <unistd.h>
 #else
 #else
-#include <Windows.h>
+#include <windows.h>
 #include "getopt/getopt.h"
 #include "getopt/getopt.h"
 #endif
 #endif
 
 

+ 1 - 1
src/rtl_fm.c

@@ -52,7 +52,7 @@
 #ifndef _WIN32
 #ifndef _WIN32
 #include <unistd.h>
 #include <unistd.h>
 #else
 #else
-#include <Windows.h>
+#include <windows.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #include <io.h>
 #include <io.h>
 #include "getopt/getopt.h"
 #include "getopt/getopt.h"

+ 1 - 1
src/rtl_power.c

@@ -49,7 +49,7 @@
 #ifndef _WIN32
 #ifndef _WIN32
 #include <unistd.h>
 #include <unistd.h>
 #else
 #else
-#include <Windows.h>
+#include <windows.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #include <io.h>
 #include <io.h>
 #include "getopt/getopt.h"
 #include "getopt/getopt.h"

+ 1 - 1
src/rtl_sdr.c

@@ -25,7 +25,7 @@
 #ifndef _WIN32
 #ifndef _WIN32
 #include <unistd.h>
 #include <unistd.h>
 #else
 #else
-#include <Windows.h>
+#include <windows.h>
 #include <io.h>
 #include <io.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #include "getopt/getopt.h"
 #include "getopt/getopt.h"

+ 5 - 1
src/rtl_tcp.c

@@ -33,7 +33,7 @@
 #include <netinet/in.h>
 #include <netinet/in.h>
 #include <fcntl.h>
 #include <fcntl.h>
 #else
 #else
-#include <WinSock2.h>
+#include <winsock2.h>
 #include "getopt/getopt.h"
 #include "getopt/getopt.h"
 #endif
 #endif
 
 
@@ -109,7 +109,11 @@ int gettimeofday(struct timeval *tv, void* ignored)
 		tmp <<= 32;
 		tmp <<= 32;
 		tmp |= ft.dwLowDateTime;
 		tmp |= ft.dwLowDateTime;
 		tmp /= 10;
 		tmp /= 10;
+#ifdef _MSC_VER
 		tmp -= 11644473600000000Ui64;
 		tmp -= 11644473600000000Ui64;
+#else
+		tmp -= 11644473600000000ULL;
+#endif
 		tv->tv_sec = (long)(tmp / 1000000UL);
 		tv->tv_sec = (long)(tmp / 1000000UL);
 		tv->tv_usec = (long)(tmp % 1000000UL);
 		tv->tv_usec = (long)(tmp % 1000000UL);
 	}
 	}

+ 1 - 1
src/rtl_test.c

@@ -32,7 +32,7 @@
 #ifndef _WIN32
 #ifndef _WIN32
 #include <unistd.h>
 #include <unistd.h>
 #else
 #else
-#include <Windows.h>
+#include <windows.h>
 #include "getopt/getopt.h"
 #include "getopt/getopt.h"
 #endif
 #endif