#ifdef WIN32
#include "win32_compat.h"
-#else
-#include <strings.h>
-#include <netdb.h>
-#include <sys/socket.h>
+#endif
+
+#ifdef HAVE_NET_IF_H
#include <net/if.h>
-#include <netinet/in.h>
-#endif /*WIN32*/
+#endif
#ifdef ANDROID
#define statvfs statfs
#include <sys/ioctl.h>
#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>