]> Savannah Git Hosting - gnulib.git/commitdiff
getloadavg: Allow building on Windows without Cygwin
authorPaul Smith <psmith@gnu.org>
Sun, 17 Jun 2018 18:22:18 +0000 (11:22 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 17 Jun 2018 18:23:01 +0000 (11:23 -0700)
* lib/getloadavg.c: Reinstate ifdef for HAVE_UNISTD_H.
* m4/getloadavg.m4: Check for unistd.h.

ChangeLog
lib/getloadavg.c
m4/getloadavg.m4

index 1104876572a2dbe4bc8f3737861db1d73a4d0b86..a8a74190ba79b471f04966e2655bc7339cb2da78 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 702338fb9e9b2a8f4bf05e5d096920909ef6aeca..4ce40517a3d33b111102190b0622df311f15c5fb 100644 (file)
 #  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.  */
index d3a8910ecfca04424032f869a32d3957b6c4acd2..c9f5a6da5df79032ab2a2eb2680f3170a239a0b2 100644 (file)
@@ -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