From: Paul Smith Date: Sun, 17 Jun 2018 18:22:18 +0000 (-0700) Subject: getloadavg: Allow building on Windows without Cygwin X-Git-Tag: v1.0~5574 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=b8b534b828fb8e2591cd11a9ac86c9d190ac6b64;p=gnulib.git getloadavg: Allow building on Windows without Cygwin * lib/getloadavg.c: Reinstate ifdef for HAVE_UNISTD_H. * m4/getloadavg.m4: Check for unistd.h. --- diff --git a/ChangeLog b/ChangeLog index 1104876572..a8a74190ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-06-17 Paul Smith + + getloadavg: Allow building on Windows without Cygwin + * lib/getloadavg.c: Reinstate ifdef for HAVE_UNISTD_H. + * m4/getloadavg.m4: Check for unistd.h. + 2018-06-03 Paul Eggert Port crypto/af_alg to GCC 4.8.4 diff --git a/lib/getloadavg.c b/lib/getloadavg.c index 702338fb9e..4ce40517a3 100644 --- a/lib/getloadavg.c +++ b/lib/getloadavg.c @@ -324,7 +324,9 @@ # define LDAV_SYMBOL "avenrun" # endif -# include +# ifdef HAVE_UNISTD_H +# include +# endif /* LOAD_AVE_TYPE should only get defined if we're going to use the nlist method. */ diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 index d3a8910ecf..c9f5a6da5d 100644 --- a/m4/getloadavg.m4 +++ b/m4/getloadavg.m4 @@ -108,7 +108,7 @@ AC_DEFUN([gl_PREREQ_GETLOADAVG], [ # Figure out what our getloadavg.c needs. -AC_CHECK_HEADERS_ONCE([sys/param.h]) +AC_CHECK_HEADERS_ONCE([sys/param.h unistd.h]) # On HPUX9, an unprivileged user can get load averages this way. if test $gl_func_getloadavg_done = no; then