immutable: Add tests.
[gnulib.git] / m4 / poll_h.m4
blob20692d86664dbda029a75e6dc76b132eea8aea06
1 # poll_h.m4 serial 3
2 dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 dnl Written by Bruno Haible.
9 AC_DEFUN([gl_POLL_H],
11   dnl Use AC_REQUIRE here, so that the default behavior below is expanded
12   dnl once only, before all statements that occur in other macros.
13   AC_REQUIRE([gl_POLL_H_DEFAULTS])
15   AC_CHECK_HEADERS_ONCE([poll.h])
16   if test $ac_cv_header_poll_h = yes; then
17     HAVE_POLL_H=1
18   else
19     HAVE_POLL_H=0
20   fi
21   AC_SUBST([HAVE_POLL_H])
23   dnl <poll.h> is always overridden, because of GNULIB_POSIXCHECK.
24   gl_CHECK_NEXT_HEADERS([poll.h])
26   gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
28   dnl Check for declarations of anything we want to poison if the
29   dnl corresponding gnulib module is not in use.
30   gl_WARN_ON_USE_PREPARE([[#include <poll.h>]],
31     [poll])
34 AC_DEFUN([gl_POLL_MODULE_INDICATOR],
36   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
37   AC_REQUIRE([gl_POLL_H_DEFAULTS])
38   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
39   dnl Define it also as a C macro, for the benefit of the unit tests.
40   gl_MODULE_INDICATOR_FOR_TESTS([$1])
43 AC_DEFUN([gl_POLL_H_DEFAULTS],
45   GNULIB_POLL=0;        AC_SUBST([GNULIB_POLL])
46   dnl Assume proper GNU behavior unless another module says otherwise.
47   HAVE_POLL=1;          AC_SUBST([HAVE_POLL])
48   REPLACE_POLL=0;       AC_SUBST([REPLACE_POLL])