Commit 9a3ad1df authored by George Matsumura's avatar George Matsumura
Browse files

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's avatarGeorge Matsumura <gmmatsumura01@bvsd.org>
parent 3b1bf9d6
......@@ -88,7 +88,7 @@ AC_CHECK_HEADERS([stdint.h inttypes.h sys/int_types.h])
AC_CHECK_TYPES([uint64_t, uint128_t, __uint128_t])
dnl Check for socket support for any2ppm daemon
AC_CHECK_HEADERS([fcntl.h unistd.h signal.h sys/stat.h sys/socket.h sys/poll.h sys/un.h])
AC_CHECK_HEADERS([fcntl.h unistd.h signal.h poll.h sys/stat.h sys/socket.h sys/poll.h sys/un.h])
dnl Check for infinite loops
AC_CHECK_FUNCS([alarm])
......
......@@ -44,6 +44,7 @@ check_headers = [
['signal.h'],
['sys/stat.h'],
['sys/socket.h'],
['poll.h'],
['sys/poll.h'],
['sys/un.h'],
['sched.h', {'check-funcs': ['sched_getaffinity']}],
......
......@@ -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 */
......
......@@ -79,15 +79,23 @@
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/mman.h>
#include <sys/poll.h>
#include <sys/un.h>
#include <errno.h>
#include <assert.h>
#include <unistd.h>
#if CAIRO_HAS_REAL_PTHREAD
#include <pthread.h>
#endif
#if defined(HAVE_POLL_H)
#include <poll.h>
#elif defined(HAVE_SYS_POLL_H)
#include <sys/poll.h>
#else
#error No poll.h equivalent found
#endif
#if HAVE_FCFINI
#include <fontconfig/fontconfig.h>
#endif
......
......@@ -15,7 +15,6 @@
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/socket.h>
#include <sys/poll.h>
#include <sys/un.h>
#include <unistd.h>
#include <fcntl.h>
......@@ -24,6 +23,14 @@
#include <assert.h>
#include <pthread.h>
#if defined(HAVE_POLL_H)
#include <poll.h>
#elif defined(HAVE_SYS_POLL_H)
#include <sys/poll.h>
#else
#error No poll.h equivalent found
#endif
#include <cairo.h>
#include <cairo-script.h>
#include <cairo-script-interpreter.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment