Browse code

o Include <sys/types.h> before any other <sys/foo> and network-related headers;

o on FreeBSD, it is necessary to include <netinet/in_systm.h> before
<netinet/ip.h>, so that add it and make conditional on a new
HAVE_NETINET_IN_SYSTM define. I suspect that other BSD-derifed platforms
need it as well.

Maxim Sobolev authored on 17/11/2005 01:24:03
Showing 2 changed files
... ...
@@ -1066,7 +1066,8 @@ endif
1066 1066
 ifeq ($(OS), freebsd)
1067 1067
 	DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN \
1068 1068
 		-DHAVE_SCHED_YIELD -DHAVE_MSGHDR_MSG_CONTROL \
1069
-		-DHAVE_CONNECT_ECONNRESET_BUG -DHAVE_TIMEGM
1069
+		-DHAVE_CONNECT_ECONNRESET_BUG -DHAVE_TIMEGM \
1070
+		-DHAVE_NETINET_IN_SYSTM
1070 1071
 	ifneq ($(found_lock_method), yes)
1071 1072
 		DEFS+= -DUSE_PTHREAD_MUTEX  # try pthread sems
1072 1073
 		found_lock_method=yes
... ...
@@ -71,12 +71,15 @@
71 71
 #include <string.h>
72 72
 #include <netdb.h>
73 73
 #include <unistd.h>
74
+#include <sys/types.h>
74 75
 #include <sys/socket.h>
76
+#if defined(HAVE_NETINET_IN_SYSTM)
77
+#include <netinet/in_systm.h>
78
+#endif
75 79
 #include <netinet/in.h>
76 80
 #include <netinet/ip.h>
77 81
 #include <arpa/inet.h>
78 82
 #include <sys/utsname.h>
79
-#include <sys/types.h>
80 83
 #include <sys/stat.h>
81 84
 #include <sys/mman.h>
82 85
 #include <fcntl.h>