comparison 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
comparison
equal deleted inserted replaced
283:d71e5e1f49cf 284:6376b514a30b
50 #define RSXR_DEATHTYPE 0xABCD0014 50 #define RSXR_DEATHTYPE 0xABCD0014
51 #define RSXR_CTYPES 0XABCD0015 51 #define RSXR_CTYPES 0XABCD0015
52 #define RSXR_COORDLIST 0XABCD0016 52 #define RSXR_COORDLIST 0XABCD0016
53 #define RSXR_ROOMS 0XABCD0017 53 #define RSXR_ROOMS 0XABCD0017
54 54
55 #ifdef HAVE_CONFIG_H
56 #include "config.h"
57 #endif
58
55 #if defined(_WIN32) 59 #if defined(_WIN32)
56 #include <Windows.h> 60 #include <Windows.h>
57 #include <Lmcons.h> 61 #include <Lmcons.h>
58 #include <shlobj.h> 62 #include <shlobj.h>
59 #include <Shlwapi.h> 63 #include <Shlwapi.h>
60 #undef MOUSE_MOVED 64 #undef MOUSE_MOVED
61 #elif defined(__DJGPP__) 65 #elif defined(__DJGPP__)
62 #include <process.h> 66 #include <process.h>
63 #else 67 #else
64 #include <pwd.h> 68 #include <pwd.h>
69 #include <sys/wait.h>
65 #include <sys/utsname.h> 70 #include <sys/utsname.h>
66 #include <unistd.h> 71 #include <unistd.h>
67 #endif 72 #endif
68 73
69 #include <stdlib.h> 74 #include <stdlib.h>
80 #include "rogue.h" 85 #include "rogue.h"
81 #include "mach_dep.h" 86 #include "mach_dep.h"
82 87
83 #if defined(_WIN32) 88 #if defined(_WIN32)
84 #include <process.h> 89 #include <process.h>
90 #endif
91
92 #ifdef HAVE_ARPA_INET_H
93 #include <arpa/inet.h>
85 #endif 94 #endif
86 95
87 int md_fileno(FILE *fp); 96 int md_fileno(FILE *fp);
88 97
89 #define READSTAT ((format_error == 0) && (read_error == 0)) 98 #define READSTAT ((format_error == 0) && (read_error == 0))
3437 int md_endian = 0x01020304; 3446 int md_endian = 0x01020304;
3438 3447
3439 unsigned long int 3448 unsigned long int
3440 md_ntohl(unsigned long int x) 3449 md_ntohl(unsigned long int x)
3441 { 3450 {
3442 #ifdef _WIN32 3451 #ifndef HAVE_ARPA_INET_H
3443 if ( *((char *)&md_endian) == 0x01 ) 3452 if ( *((char *)&md_endian) == 0x01 )
3444 return(x); 3453 return(x);
3445 else 3454 else
3446 return( ((x & 0x000000ffU) << 24) | 3455 return( ((x & 0x000000ffU) << 24) |
3447 ((x & 0x0000ff00U) << 8) | 3456 ((x & 0x0000ff00U) << 8) |
3453 } 3462 }
3454 3463
3455 unsigned long int 3464 unsigned long int
3456 md_htonl(unsigned long int x) 3465 md_htonl(unsigned long int x)
3457 { 3466 {
3458 #ifdef _WIN32 3467 #ifndef HAVE_ARPA_INET_H
3459 if ( *((char *)&md_endian) == 0x01 ) 3468 if ( *((char *)&md_endian) == 0x01 )
3460 return(x); 3469 return(x);
3461 else 3470 else
3462 return( ((x & 0x000000ffU) << 24) | 3471 return( ((x & 0x000000ffU) << 24) |
3463 ((x & 0x0000ff00U) << 8) | 3472 ((x & 0x0000ff00U) << 8) |