portability fixes for header files
Costa Tsaousis committed
Dec 20, 2016 at 20:47 UTC
6ffe826bc99bcc969ba901d2416d299ea1775425
2 files changed
+21
-2
configure.ac
+2
@@ -120,6 +120,8 @@ AC_C__GENERIC
120
AC_C___ATOMIC
121
AC_CHECK_SIZEOF([void *])
122
AC_CANONICAL_HOST
123
+AC_HEADER_MAJOR
124
+AC_HEADER_RESOLV
125
126
AC_ARG_VAR([SSE_CANDIDATE], [C compiler flags for SSE])
127
AS_CASE([$host_cpu],
src/common.h
+19
-2
@@ -39,9 +39,16 @@
39
#include <strings.h>
40
41
#include <arpa/inet.h>
42
-#include <netinet/in.h>
42
#include <netinet/tcp.h>
43
44
+#ifdef HAVE_NETINET_IN_H
45
+#include <netinet/in.h>
46
+#endif
47
+
48
+#ifdef HAVE_RESOLV_H
49
+#include <resolv.h>
50
+#endif
51
+
52
#include <dirent.h>
53
#include <fcntl.h>
54
#include <getopt.h>
@@ -49,7 +56,10 @@
56
#include <pwd.h>
57
#include <locale.h>
58
59
+#ifdef HAVE_NETDB_H
60
#include <netdb.h>
61
+#endif
62
+
63
#include <poll.h>
64
#include <signal.h>
65
#include <syslog.h>
@@ -64,12 +74,19 @@
74
#include <sys/syscall.h>
75
#include <sys/time.h>
76
#include <sys/types.h>
67
-#include <sys/sysmacros.h> // #1408
77
#include <sys/wait.h>
78
#include <time.h>
79
#include <unistd.h>
80
#include <uuid/uuid.h>
81
82
+// #1408
83
+#ifdef MAJOR_IN_MKDEV
84
+#include <sys/mkdev.h>
85
+#endif
86
+#ifdef MAJOR_IN_SYSMACROS
87
+#include <sys/sysmacros.h>
88
+#endif
89
+
90
/*
91
#include <mntent.h>
92
*/