diff urogue/mdport.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 d71e5e1f49cf
children 3b61f1dfcc91
line wrap: on
line diff
--- a/urogue/mdport.c	Mon Sep 18 19:36:14 2017 -0400
+++ b/urogue/mdport.c	Fri Sep 22 16:24:40 2017 -0400
@@ -49,6 +49,7 @@
 #else
 #include <pwd.h>
 #include <sys/utsname.h>
+#include <sys/wait.h>
 #include <unistd.h>
 #include <utmpx.h>
 #endif
@@ -57,6 +58,10 @@
 #include <stdlib.h>
 #include <string.h>
 
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif
+
 #if defined(_WIN32) && !defined(__MINGW32__)
 #define PATH_MAX MAX_PATH
 #endif
@@ -544,7 +549,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
@@ -560,7 +565,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