Browse Source

Bugfix: api-example: Try to use BSD sockets on any non-Windows platform

Luke Dashjr 13 years ago
parent
commit
b5170797cd
1 changed files with 2 additions and 4 deletions
  1. 2 4
      api-example.c

+ 2 - 4
api-example.c

@@ -21,7 +21,7 @@
 #include "compat.h"
 #include "miner.h"
 
-#if defined(unix)
+#ifndef WIN32
 	#include <errno.h>
 	#include <sys/socket.h>
 	#include <netinet/in.h>
@@ -36,9 +36,7 @@
 	#define SOCKETINIT {}
 
 	#define SOCKERRMSG strerror(errno)
-#endif
-
-#ifdef WIN32
+#else
 	#include <winsock2.h>
 	#include "inet_ntop.h"
 	#include "inet_pton.h"