Browse Source

Merge commit '144a016' into stratum

Luke Dashjr 13 years ago
parent
commit
d77fa1f7ff
3 changed files with 12 additions and 10 deletions
  1. 0 10
      api.c
  2. 4 0
      miner.h
  3. 8 0
      util.h

+ 0 - 10
api.c

@@ -32,16 +32,6 @@
 #define HAVE_AN_FPGA 1
 #endif
 
-#if defined(unix) || defined(__APPLE__)
-	#include <errno.h>
-	#include <sys/socket.h>
-	#include <netinet/in.h>
-	#include <arpa/inet.h>
-#elif defined WIN32
-	#include <ws2tcpip.h>
-	#include <winsock2.h>
-#endif
-
 // Big enough for largest API request
 //  though a PC with 100s of PGAs/CPUs may exceed the size ...
 // Current code assumes it can socket send this size also

+ 4 - 0
miner.h

@@ -16,6 +16,7 @@
 #include "elist.h"
 #include "uthash.h"
 #include "logging.h"
+#include "util.h"
 
 #ifdef HAVE_OPENCL
 #include "CL/cl.h"
@@ -894,6 +895,9 @@ struct pool {
 
 	struct cgminer_stats cgminer_stats;
 	struct cgminer_pool_stats cgminer_pool_stats;
+
+	SOCKETTYPE sock;
+	struct sockaddr_in server, client;
 };
 
 #define GETWORK_MODE_TESTPOOL 'T'

+ 8 - 0
util.h

@@ -2,6 +2,11 @@
 #define __UTIL_H__
 
 #if defined(unix) || defined(__APPLE__)
+	#include <errno.h>
+	#include <sys/socket.h>
+	#include <netinet/in.h>
+	#include <arpa/inet.h>
+
 	#define SOCKETTYPE int
 	#define SOCKETFAIL(a) ((a) < 0)
 	#define INVSOCK -1
@@ -10,6 +15,9 @@
 
 	#define SOCKERRMSG strerror(errno)
 #elif defined WIN32
+	#include <ws2tcpip.h>
+	#include <winsock2.h>
+
 	#define SOCKETTYPE SOCKET
 	#define SOCKETFAIL(a) ((a) == SOCKET_ERROR)
 	#define INVSOCK INVALID_SOCKET