Browse Source

Make raw sockets compile on windows

nfactor-troky
Con Kolivas 12 years ago
parent
commit
68196588c9
  1. 3
      configure.ac
  2. 6
      miner.h
  3. 2
      util.c

3
configure.ac

@ -188,7 +188,8 @@ scrypt="no" @@ -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

6
miner.h

@ -14,8 +14,10 @@ @@ -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__

2
util.c

@ -206,7 +206,7 @@ static void keep_sockalive(SOCKETTYPE fd) @@ -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));

Loading…
Cancel
Save