summaryrefslogtreecommitdiff
path: root/test/any2ppm.c
diff options
context:
space:
mode:
authorGeorge Matsumura <gmmatsumura01@bvsd.org>2020-08-31 01:36:20 -0600
committerGeorge Matsumura <gmmatsumura01@bvsd.org>2020-09-05 12:15:57 +0000
commit9a3ad1df1cdca3559d0102918b7527005605df1a (patch)
treed508e1a8c5b3d67343efc46995fababd388d29a2 /test/any2ppm.c
parent3b1bf9d6d3cbf2074eb347bc4cb33704f57d800d (diff)
downloadcairo-9a3ad1df1cdca3559d0102918b7527005605df1a.tar.gz
build: Include correct poll.h
Including sys/poll.h when poll.h is available produces a compile warning on some systems, but only sys/poll.h is present on others such as AIX. This makes sure the most suitable poll.h is included in each situation. Signed-off-by: George Matsumura <gmmatsumura01@bvsd.org>
Diffstat (limited to 'test/any2ppm.c')
-rw-r--r--test/any2ppm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/any2ppm.c b/test/any2ppm.c
index ac3b7f051..8d8d2f2cf 100644
--- a/test/any2ppm.c
+++ b/test/any2ppm.c
@@ -85,13 +85,18 @@
#include <fcntl.h>
#endif
-#if HAVE_UNISTD_H && HAVE_SIGNAL_H && HAVE_SYS_STAT_H && HAVE_SYS_SOCKET_H && HAVE_SYS_POLL_H && HAVE_SYS_UN_H
+#if HAVE_UNISTD_H && HAVE_SIGNAL_H && HAVE_SYS_STAT_H && HAVE_SYS_SOCKET_H && (HAVE_POLL_H || HAVE_SYS_POLL_H) && HAVE_SYS_UN_H
#include <signal.h>
#include <sys/stat.h>
#include <sys/socket.h>
-#include <sys/poll.h>
#include <sys/un.h>
+#if defined(HAVE_POLL_H)
+#include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
+#include <sys/poll.h>
+#endif
+
#define SOCKET_PATH "./.any2ppm"
#define TIMEOUT 60000 /* 60 seconds */