Add required POSIX includes and fairly portable Unix include.

POSIX specifies that inet_ntoa() is declared in arpa/inet.h, and that
POLLRDNORM, etc. are defined in poll.h.

gethostbyname() is not specified by POSIX, but the manpages in OpenBSD,
FreeBSD, OS X, and glibc all state that it is declared in netdb.h.

Without these headers, the build fails on OpenBSD and possibly other
systems.
This commit is contained in:
Anthony J. Bentley 2016-07-17 03:59:30 -06:00
parent 92594e08d4
commit f4cc52813c
2 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,11 @@
#include <cstdio>
#include <cstdlib>
#include <string>
#ifndef _WIN32
#include <arpa/inet.h>
#include <netdb.h>
#include <poll.h>
#endif
#include "Common/CommonPaths.h"
#include "Common/FileUtil.h"

View File

@ -4,6 +4,7 @@
#include <algorithm>
#ifndef _WIN32
#include <arpa/inet.h>
#include <unistd.h>
#endif