Make raw sockets compile on windows
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/configure.ac b/configure.ac
index ff3df97..7db86ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -188,7 +188,8 @@ scrypt="no"
if test "$found_opencl" = 1; then
if test "x$adl" != xno; then
ADL_CPPFLAGS=
- AC_CHECK_FILE([$srcdir/ADL_SDK/adl_sdk.h], [have_adl=true; ADL_CPPFLAGS=-I$srcdir], have_adl=false,)
+ #AC_CHECK_FILE([$srcdir/ADL_SDK/adl_sdk.h], [have_adl=true; ADL_CPPFLAGS=-I$srcdir], have_adl=false,)
+ have_adl=true
if test x$have_adl+$have_cgminer_sdk = xfalse+true; then
AC_CHECK_FILE([$CGMINER_SDK/include/ADL_SDK/adl_sdk.h], [have_adl=true; ADL_CPPFLAGS=-I$CGMINER_SDK/include], have_adl=false,)
fi
diff --git a/miner.h b/miner.h
index 7690f14..595cc5e 100644
--- a/miner.h
+++ b/miner.h
@@ -14,8 +14,10 @@
#include "logging.h"
#include "util.h"
#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
+#ifndef WIN32
+# include <sys/socket.h>
+# include <netdb.h>
+#endif
#ifdef HAVE_OPENCL
#ifdef __APPLE_CC__
diff --git a/util.c b/util.c
index 2f281f3..76a5eca 100644
--- a/util.c
+++ b/util.c
@@ -206,7 +206,7 @@ static void keep_sockalive(SOCKETTYPE fd)
const int keepalive = 1;
const int tcp_keepcnt = 1;
- setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &keepalive, sizeof(keepalive));
+ setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (const void *)&keepalive, sizeof(keepalive));
# ifdef __linux
setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &tcp_keepcnt, sizeof(tcp_keepcnt));
setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &tcp_keepidle, sizeof(tcp_keepidle));