diff options
author | Paul Smith <psmith@gnu.org> | 2018-06-17 11:22:18 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2018-06-17 11:23:01 -0700 |
commit | b8b534b828fb8e2591cd11a9ac86c9d190ac6b64 (patch) | |
tree | 94a16a741aaecc3fbea47d3a0a03dcd271f09315 | |
parent | 7ff7a27a8a988a5aa058ce29e1e219e4fa75940f (diff) | |
download | gnulib-b8b534b828fb8e2591cd11a9ac86c9d190ac6b64.tar.gz |
getloadavg: Allow building on Windows without Cygwin
* lib/getloadavg.c: Reinstate ifdef for HAVE_UNISTD_H.
* m4/getloadavg.m4: Check for unistd.h.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/getloadavg.c | 4 | ||||
-rw-r--r-- | m4/getloadavg.m4 | 2 |
3 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2018-06-17 Paul Smith <psmith@gnu.org> + + 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 <eggert@cs.ucla.edu> 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 <unistd.h> +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# 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 |