Mercurial > hg > early-roguelike
comparison arogue5/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 | 17005af49963 |
comparison
equal
deleted
inserted
replaced
| 283:d71e5e1f49cf | 284:6376b514a30b |
|---|---|
| 39 #include <shlobj.h> | 39 #include <shlobj.h> |
| 40 #include <sys/types.h> | 40 #include <sys/types.h> |
| 41 #undef MOUSE_MOVED | 41 #undef MOUSE_MOVED |
| 42 #elif defined(__DJGPP__) | 42 #elif defined(__DJGPP__) |
| 43 #include <process.h> | 43 #include <process.h> |
| 44 #else | |
| 45 #include <sys/wait.h> | |
| 44 #endif | 46 #endif |
| 45 | 47 |
| 46 #ifdef HAVE_PWD_H | 48 #ifdef HAVE_PWD_H |
| 47 #include <pwd.h> | 49 #include <pwd.h> |
| 50 #endif | |
| 51 #ifdef HAVE_ARPA_INET_H | |
| 52 #include <arpa/inet.h> | |
| 48 #endif | 53 #endif |
| 49 #ifdef HAVE_SYS_UTSNAME_H | 54 #ifdef HAVE_SYS_UTSNAME_H |
| 50 #include <sys/utsname.h> | 55 #include <sys/utsname.h> |
| 51 #endif | 56 #endif |
| 52 #ifdef HAVE_UNISTD_H | 57 #ifdef HAVE_UNISTD_H |
| 550 int md_endian = 0x01020304; | 555 int md_endian = 0x01020304; |
| 551 | 556 |
| 552 unsigned long int | 557 unsigned long int |
| 553 md_ntohl(unsigned long int x) | 558 md_ntohl(unsigned long int x) |
| 554 { | 559 { |
| 555 #ifdef _WIN32 | 560 #ifndef HAVE_ARPA_INET_H |
| 556 if ( *((char *)&md_endian) == 0x01 ) | 561 if ( *((char *)&md_endian) == 0x01 ) |
| 557 return(x); | 562 return(x); |
| 558 else | 563 else |
| 559 return( ((x & 0x000000ffU) << 24) | | 564 return( ((x & 0x000000ffU) << 24) | |
| 560 ((x & 0x0000ff00U) << 8) | | 565 ((x & 0x0000ff00U) << 8) | |
| 566 } | 571 } |
| 567 | 572 |
| 568 unsigned long int | 573 unsigned long int |
| 569 md_htonl(unsigned long int x) | 574 md_htonl(unsigned long int x) |
| 570 { | 575 { |
| 571 #ifdef _WIN32 | 576 #ifndef HAVE_ARPA_INET_H |
| 572 if ( *((char *)&md_endian) == 0x01 ) | 577 if ( *((char *)&md_endian) == 0x01 ) |
| 573 return(x); | 578 return(x); |
| 574 else | 579 else |
| 575 return( ((x & 0x000000ffU) << 24) | | 580 return( ((x & 0x000000ffU) << 24) | |
| 576 ((x & 0x0000ff00U) << 8) | | 581 ((x & 0x0000ff00U) << 8) | |
