1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-22 20:44:19 +00:00

Make raw sockets compile on windows

This commit is contained in:
Con Kolivas 2013-05-09 11:39:09 +10:00
parent 43bcccf868
commit 68196588c9
3 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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
View File

@ -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));