From ee9ff27f9ff34558a86bf9b042e67f71e189be7e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 17 Jun 2018 22:29:54 +0200 Subject: [PATCH] getloadavg: Return 0 on Windows without Cygwin. * lib/getloadavg.c: Don't assume that the symbol WINDOWS32 is defined. --- ChangeLog | 5 +++++ lib/getloadavg.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a8a74190ba..dd0f58d8ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-06-17 Bruno Haible + + getloadavg: Return 0 on Windows without Cygwin. + * lib/getloadavg.c: Don't assume that the symbol WINDOWS32 is defined. + 2018-06-17 Paul Smith getloadavg: Allow building on Windows without Cygwin diff --git a/lib/getloadavg.c b/lib/getloadavg.c index 4ce40517a3..435d10a6b1 100644 --- a/lib/getloadavg.c +++ b/lib/getloadavg.c @@ -68,7 +68,7 @@ UMAX UMAX4_3 VMS - WINDOWS32 No-op for Windows95/NT. + _WIN32 Native Windows (possibly also defined on Cygwin) __linux__ Linux: assumes /proc file system mounted. Support from Michael K. Johnson. __CYGWIN__ Cygwin emulates linux /proc/loadavg. @@ -97,6 +97,10 @@ # include "intprops.h" +# if defined _WIN32 && ! defined __CYGWIN__ +# define WINDOWS32 +# endif + # if !defined (BSD) && defined (ultrix) /* Ultrix behaves like BSD on Vaxen. */ # define BSD -- 2.39.5