aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2018-10-13 14:00:16 -0700
committerH. Peter Anvin <hpa@zytor.com>2018-10-13 14:00:16 -0700
commitf4bae3a455e2aa03c8f3b9647e323ac5f74b6992 (patch)
treeb7f1e785e66bec7191e557d29bf1479f636b1805
parent6bf2281fe94e337d9729cc39fec0de7fdbf2ad94 (diff)
downloadgrv-f4bae3a455e2aa03c8f3b9647e323ac5f74b6992.tar.gz
grv-f4bae3a455e2aa03c8f3b9647e323ac5f74b6992.tar.xz
grv-f4bae3a455e2aa03c8f3b9647e323ac5f74b6992.zip
Fix netopen.c errors
-rw-r--r--netopen.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/netopen.c b/netopen.c
index 71486c1..79f2461 100644
--- a/netopen.c
+++ b/netopen.c
@@ -6,18 +6,19 @@
*/
#include "network.h"
-#include <stdio.h>
#ifdef __WIN32__
-#define _WIN32_WINNT 0x0501 /* Windows XP */
+#ifndef _WIN32_WINNT
+# define _WIN32_WINNT 0x0501 /* Windows XP */
+#endif
+
#include <winsock2.h>
#include <windows.h>
-#include <string.h>
-#include <io.h>
-#include <fcntl.h>
#include <ws2tcpip.h>
+#include "compiler.h"
+
static int winsock_started = 0;
int socket_errno; /* For debuggability */
@@ -60,9 +61,10 @@ static FILE *sock_to_file(SOCKET sock, int is_write)
#else
/* Unix, or something else which implements BSD sockets correctly */
+#include "compiler.h"
+
#include <unistd.h>
#include <netdb.h>
-#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>