[cairo-commit] build/configure.ac.system meson.build test/any2ppm.c test/cairo-test-trace.c util/cairo-sphinx

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Sep 5 12:32:18 UTC 2020


 build/configure.ac.system  |    2 +-
 meson.build                |    1 +
 test/any2ppm.c             |    9 +++++++--
 test/cairo-test-trace.c    |   10 +++++++++-
 util/cairo-sphinx/sphinx.c |    9 ++++++++-
 5 files changed, 26 insertions(+), 5 deletions(-)

New commits:
commit 9a3ad1df1cdca3559d0102918b7527005605df1a
Author: George Matsumura <gmmatsumura01 at bvsd.org>
Date:   Mon Aug 31 01:36:20 2020 -0600

    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 at bvsd.org>

diff --git a/build/configure.ac.system b/build/configure.ac.system
index def75cdc1..383f28d46 100644
--- a/build/configure.ac.system
+++ b/build/configure.ac.system
@@ -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])
diff --git a/meson.build b/meson.build
index 9a78591bc..fddb3a28c 100644
--- a/meson.build
+++ b/meson.build
@@ -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']}],
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 */
 
diff --git a/test/cairo-test-trace.c b/test/cairo-test-trace.c
index 6b7e00afc..4eee5d30b 100644
--- a/test/cairo-test-trace.c
+++ b/test/cairo-test-trace.c
@@ -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
diff --git a/util/cairo-sphinx/sphinx.c b/util/cairo-sphinx/sphinx.c
index 238d40064..5c5fcee77 100644
--- a/util/cairo-sphinx/sphinx.c
+++ b/util/cairo-sphinx/sphinx.c
@@ -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>


More information about the cairo-commit mailing list