diff xrogue/state.c @ 284:6376b514a30b

Fix more header-related warnings. This fixes all current default warnings with GCC7 on Linux. That does not mean the code is anywhere close to clean.
author John "Elwin" Edwards
date Fri, 22 Sep 2017 16:24:40 -0400
parents d3968e9cb98d
children 17005af49963
line wrap: on
line diff
--- a/xrogue/state.c	Mon Sep 18 19:36:14 2017 -0400
+++ b/xrogue/state.c	Fri Sep 22 16:24:40 2017 -0400
@@ -52,6 +52,10 @@
 #define RSXR_COORDLIST    0XABCD0016
 #define RSXR_ROOMS        0XABCD0017
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #if defined(_WIN32)
 #include <Windows.h>
 #include <Lmcons.h>
@@ -62,6 +66,7 @@
 #include <process.h>
 #else
 #include <pwd.h>
+#include <sys/wait.h>
 #include <sys/utsname.h>
 #include <unistd.h>
 #endif
@@ -84,6 +89,10 @@
 #include <process.h>
 #endif
 
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
 int md_fileno(FILE *fp);
 
 #define READSTAT ((format_error == 0) && (read_error == 0))
@@ -3439,7 +3448,7 @@
 unsigned long int
 md_ntohl(unsigned long int x)
 {
-#ifdef _WIN32
+#ifndef HAVE_ARPA_INET_H
     if ( *((char *)&md_endian) == 0x01 )
         return(x);
     else
@@ -3455,7 +3464,7 @@
 unsigned long int
 md_htonl(unsigned long int x)
 {
-#ifdef _WIN32
+#ifndef HAVE_ARPA_INET_H
     if ( *((char *)&md_endian) == 0x01 )
         return(x);
     else