From 98ca18573eff36565891d85a6c52445528514116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fred=20Helmesj=C3=B6?= Date: Thu, 1 Sep 2022 09:26:57 +0200 Subject: [PATCH] Add HAVE_SLEEP, HAVE_USLEEP, HAVE_NANOSLEEP (GH PR #26) --- .../autoconf/checks/HAVE_NANOSLEEP.h | 19 +++++++++++++++++++ .../libbuild2/autoconf/checks/HAVE_SLEEP.h | 19 +++++++++++++++++++ .../libbuild2/autoconf/checks/HAVE_USLEEP.h | 18 ++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_NANOSLEEP.h create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_SLEEP.h create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_USLEEP.h diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_NANOSLEEP.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_NANOSLEEP.h new file mode 100644 index 0000000..092e835 --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_NANOSLEEP.h @@ -0,0 +1,19 @@ +// HAVE_NANOSLEEP : BUILD2_AUTOCONF_LIBC_VERSION + +#ifndef BUILD2_AUTOCONF_LIBC_VERSION +# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included +#endif + +#undef HAVE_NANOSLEEP + +/* Since OpenBSD 2.1, FreeBSD 3.0, NetBSD 1.3, Mac OS X < 10.0, + * glibc 2.1 (?) + */ +#if defined(__linux__) || \ + BUILD2_AUTOCONF_OPENBSD_PREREQ(199706) || \ + BUILD2_AUTOCONF_FREEBSD_PREREQ(3, 0) || \ + BUILD2_AUTOCONF_NETBSD_PREREQ(1, 3) || \ + BUILD2_AUTOCONF_MACOS_PREREQ(10, 0) || \ + BUILD2_AUTOCONF_GLIBC_PREREQ(2, 1) +# define HAVE_NANOSLEEP 1 +#endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_SLEEP.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_SLEEP.h new file mode 100644 index 0000000..c6e7012 --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_SLEEP.h @@ -0,0 +1,19 @@ +// HAVE_SLEEP : BUILD2_AUTOCONF_LIBC_VERSION + +#ifndef BUILD2_AUTOCONF_LIBC_VERSION +# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included +#endif + +#undef HAVE_SLEEP + +/* Since Version 4/7 AT&T UNIX. + * glibc 2.1 (?) + */ +#if defined(__linux__) || \ + BUILD2_AUTOCONF_OPENBSD_PREREQ(199706) || \ + BUILD2_AUTOCONF_FREEBSD_PREREQ(3, 0) || \ + BUILD2_AUTOCONF_NETBSD_PREREQ(1, 3) || \ + BUILD2_AUTOCONF_MACOS_PREREQ(10, 0) || \ + BUILD2_AUTOCONF_GLIBC_PREREQ(2, 1) +# define HAVE_SLEEP 1 +#endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_USLEEP.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_USLEEP.h new file mode 100644 index 0000000..a05574e --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_USLEEP.h @@ -0,0 +1,18 @@ +// HAVE_USLEEP : BUILD2_AUTOCONF_LIBC_VERSION + +#ifndef BUILD2_AUTOCONF_LIBC_VERSION +# error BUILD2_AUTOCONF_LIBC_VERSION appears to be conditionally included +#endif + +#undef HAVE_USLEEP + +/* Since 4.3BSD (OpenBSD, FreeBSD, NetBSD, Mac OS X), + * glibc 2.1 (?) + */ +#if defined(__FreeBSD__) || \ + defined(__OpenBSD__) || \ + defined(__NetBSD__) || \ + defined(BUILD2_AUTOCONF_MACOS) || \ + BUILD2_AUTOCONF_GLIBC_PREREQ(2, 1) +# define HAVE_USLEEP 1 +#endif