mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
Include <sys/select.h> for select() if available.
According to the man page, <sys/select.h> is the header to include on POSIX systems for select() and associated APIs. Fixes compilation with some versions of Cygwin (Github issue #49). configure.ac: runtime/mercury_conf.h.in Define MR_HAVE_SYS_SELECT_H if <sys/select.h> is available. runtime/mercury_reg_workarounds.c runtime/mercury_reg_workarounds.h Include <sys/select.h> if MR_HAVE_SYS_SELECT_H is defined.
This commit is contained in:
@@ -1420,7 +1420,7 @@ MERCURY_CHECK_FOR_HEADERS( \
|
|||||||
sys/types.h sys/stat.h fcntl.h termios.h sys/ioctl.h \
|
sys/types.h sys/stat.h fcntl.h termios.h sys/ioctl.h \
|
||||||
sys/resource.h sys/stropts.h windows.h dirent.h getopt.h malloc.h \
|
sys/resource.h sys/stropts.h windows.h dirent.h getopt.h malloc.h \
|
||||||
semaphore.h pthread.h time.h spawn.h fenv.h sys/mman.h sys/sem.h \
|
semaphore.h pthread.h time.h spawn.h fenv.h sys/mman.h sys/sem.h \
|
||||||
sched.h utmpx.h dispatch/dispatch.h stdint.h)
|
sched.h utmpx.h dispatch/dispatch.h stdint.h sys/select.h )
|
||||||
|
|
||||||
if test "$MR_HAVE_GETOPT_H" = 1; then
|
if test "$MR_HAVE_GETOPT_H" = 1; then
|
||||||
GETOPT_H_AVAILABLE=yes
|
GETOPT_H_AVAILABLE=yes
|
||||||
@@ -2426,6 +2426,9 @@ AC_MSG_CHECKING(to see if we can handle contexts blocking on IO)
|
|||||||
AC_CACHE_VAL(mercury_cv_can_do_pending_io,
|
AC_CACHE_VAL(mercury_cv_can_do_pending_io,
|
||||||
AC_TRY_RUN(
|
AC_TRY_RUN(
|
||||||
[
|
[
|
||||||
|
#ifdef MR_HAVE_SYS_SELECT_H
|
||||||
|
#include <sys/select.h>
|
||||||
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
int main() {
|
int main() {
|
||||||
|
|||||||
@@ -140,7 +140,8 @@
|
|||||||
// MR_HAVE_UTMPX_H we have <utmpx.h>
|
// MR_HAVE_UTMPX_H we have <utmpx.h>
|
||||||
// MR_HAVE_SYS_RESOURCE_H we have <sys/resource.h>
|
// MR_HAVE_SYS_RESOURCE_H we have <sys/resource.h>
|
||||||
// MR_HAVE_DISPATCH_DISPATCH_H we have <dispatch/dispatch.h>
|
// MR_HAVE_DISPATCH_DISPATCH_H we have <dispatch/dispatch.h>
|
||||||
// MR_HAVE_STDINT we have <stdint.h>
|
// MR_HAVE_STDINT_H we have <stdint.h>
|
||||||
|
// MR_HAVE_SYS_SELECT_H we have <sys/select.h>
|
||||||
|
|
||||||
#undef MR_HAVE_SYS_SIGINFO_H
|
#undef MR_HAVE_SYS_SIGINFO_H
|
||||||
#undef MR_HAVE_SYS_SIGNAL_H
|
#undef MR_HAVE_SYS_SIGNAL_H
|
||||||
@@ -175,6 +176,7 @@
|
|||||||
#undef MR_HAVE_SYS_RESOURCE_H
|
#undef MR_HAVE_SYS_RESOURCE_H
|
||||||
#undef MR_HAVE_DISPATCH_DISPATCH_H
|
#undef MR_HAVE_DISPATCH_DISPATCH_H
|
||||||
#undef MR_HAVE_STDINT_H
|
#undef MR_HAVE_STDINT_H
|
||||||
|
#undef MR_HAVE_SYS_SELECT_H
|
||||||
|
|
||||||
// MR_HAVE_POSIX_TIMES is defined if we have the POSIX
|
// MR_HAVE_POSIX_TIMES is defined if we have the POSIX
|
||||||
// `struct tms' struct and times() function.
|
// `struct tms' struct and times() function.
|
||||||
|
|||||||
@@ -14,15 +14,19 @@
|
|||||||
|
|
||||||
#ifdef MR_CAN_DO_PENDING_IO
|
#ifdef MR_CAN_DO_PENDING_IO
|
||||||
|
|
||||||
#ifdef MR_BZERO_NEEDS_STRINGS_HEADER
|
#ifdef MR_BZERO_NEEDS_STRINGS_HEADER
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h> // for fd_set and FD_ZERO()
|
#ifdef MR_HAVE_SYS_SELECT_H
|
||||||
#include <sys/time.h> // for FD_ZERO()
|
#include <sys/select.h> // for select() -- POSIX
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sys/types.h> // for fd_set and FD_ZERO()
|
||||||
|
#include <sys/time.h> // for FD_ZERO()
|
||||||
|
|
||||||
#ifdef MR_HAVE_UNISTD_H
|
#ifdef MR_HAVE_UNISTD_H
|
||||||
#include <unistd.h> // for FD_ZERO()
|
#include <unistd.h> // for FD_ZERO()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -12,6 +12,9 @@
|
|||||||
#include "mercury_conf.h"
|
#include "mercury_conf.h"
|
||||||
|
|
||||||
#ifdef MR_CAN_DO_PENDING_IO
|
#ifdef MR_CAN_DO_PENDING_IO
|
||||||
|
#ifdef MR_HAVE_SYS_SELECT_H
|
||||||
|
#include <sys/select.h> // for select() -- POSIX
|
||||||
|
#endif
|
||||||
#include <sys/types.h> // for fd_set
|
#include <sys/types.h> // for fd_set
|
||||||
#include <sys/time.h> // for FD_ZERO()
|
#include <sys/time.h> // for FD_ZERO()
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user