comparison arogue7/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
27 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 SUCH DAMAGE. 29 SUCH DAMAGE.
30 */ 30 */
31 31
32 #ifdef HAVE_CONFIG_H
33 #include "config.h"
34 #endif
35
32 #if defined(_WIN32) 36 #if defined(_WIN32)
33 #include <Windows.h> 37 #include <Windows.h>
34 #include <Lmcons.h> 38 #include <Lmcons.h>
35 #include <shlobj.h> 39 #include <shlobj.h>
36 #include <Shlwapi.h> 40 #include <Shlwapi.h>
38 #undef MOUSE_MOVED 42 #undef MOUSE_MOVED
39 #elif defined(__DJGPP__) 43 #elif defined(__DJGPP__)
40 #include <process.h> 44 #include <process.h>
41 #else 45 #else
42 #include <pwd.h> 46 #include <pwd.h>
47 #include <sys/wait.h>
43 #include <sys/utsname.h> 48 #include <sys/utsname.h>
44 #include <unistd.h> 49 #include <unistd.h>
45 #endif 50 #endif
46 51
47 #include <stdlib.h> 52 #include <stdlib.h>
70 #include <fcntl.h> 75 #include <fcntl.h>
71 #include <limits.h> 76 #include <limits.h>
72 #include <sys/stat.h> 77 #include <sys/stat.h>
73 #include <signal.h> 78 #include <signal.h>
74 #include <time.h> 79 #include <time.h>
80
81 #ifdef HAVE_ARPA_INET_H
82 #include <arpa/inet.h>
83 #endif
75 84
76 #define MOD_MOVE(c) (toupper(c) ) 85 #define MOD_MOVE(c) (toupper(c) )
77 86
78 void 87 void
79 md_init(void) 88 md_init(void)
531 int md_endian = 0x01020304; 540 int md_endian = 0x01020304;
532 541
533 unsigned long int 542 unsigned long int
534 md_ntohl(unsigned long int x) 543 md_ntohl(unsigned long int x)
535 { 544 {
536 #ifdef _WIN32 545 #ifndef HAVE_ARPA_INET_H
537 if ( *((char *)&md_endian) == 0x01 ) 546 if ( *((char *)&md_endian) == 0x01 )
538 return(x); 547 return(x);
539 else 548 else
540 return( ((x & 0x000000ffU) << 24) | 549 return( ((x & 0x000000ffU) << 24) |
541 ((x & 0x0000ff00U) << 8) | 550 ((x & 0x0000ff00U) << 8) |
547 } 556 }
548 557
549 unsigned long int 558 unsigned long int
550 md_htonl(unsigned long int x) 559 md_htonl(unsigned long int x)
551 { 560 {
552 #ifdef _WIN32 561 #ifndef HAVE_ARPA_INET_H
553 if ( *((char *)&md_endian) == 0x01 ) 562 if ( *((char *)&md_endian) == 0x01 )
554 return(x); 563 return(x);
555 else 564 else
556 return( ((x & 0x000000ffU) << 24) | 565 return( ((x & 0x000000ffU) << 24) |
557 ((x & 0x0000ff00U) << 8) | 566 ((x & 0x0000ff00U) << 8) |