From: Paul Eggert Date: Tue, 10 Jul 2012 23:50:06 +0000 (-0700) Subject: getloadavg: clean out old Emacs and Autoconf cruft X-Git-Tag: v0.1~546 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=dd91a295844a6e89ce67087164ea0f2e979b4b70;p=gnulib.git getloadavg: clean out old Emacs and Autoconf cruft See Glenn Morris in . * lib/getloadavg.c: Include , always. Include if HAVE_SYS_PARAM_H, not if unix or __unix. (LDAV_CVT): Remove no-longer-used LOAD_AVE_CVT hook. * m4/getloadavg.m4 (gl_PREREQ_GETLOADAVG): Check for . --- diff --git a/ChangeLog b/ChangeLog index d94f7b16d..b27ef8db0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-07-10 Paul Eggert + + getloadavg: clean out old Emacs and Autoconf cruft + See Glenn Morris in . + * lib/getloadavg.c: Include , always. + Include if HAVE_SYS_PARAM_H, not if unix or __unix. + (LDAV_CVT): Remove no-longer-used LOAD_AVE_CVT hook. + * m4/getloadavg.m4 (gl_PREREQ_GETLOADAVG): Check for . + 2012-07-10 Akim Demaille bootstrap: let warn be like tests/init.sh's warn_ diff --git a/lib/getloadavg.c b/lib/getloadavg.c index 79ea71787..a8ffefee3 100644 --- a/lib/getloadavg.c +++ b/lib/getloadavg.c @@ -80,45 +80,23 @@ We also #define LDAV_PRIVILEGED if a program will require special installation to be able to call getloadavg. */ -/* "configure" defines CONFIGURING_GETLOADAVG to sidestep problems - with partially-configured source directories. */ - -#ifndef CONFIGURING_GETLOADAVG -# include -# include -#endif +#include /* Specification. */ #include #include +#include #include # include -/* Both the Emacs and non-Emacs sections want this. Some - configuration files' definitions for the LOAD_AVE_CVT macro (like - sparc.h's) use macros like FSCALE, defined here. */ -# if defined (unix) || defined (__unix) +# if HAVE_SYS_PARAM_H # include # endif # include "intprops.h" -/* The existing Emacs configuration files define a macro called - LOAD_AVE_CVT, which accepts a value of type LOAD_AVE_TYPE, and - returns the load average multiplied by 100. What we actually want - is a macro called LDAV_CVT, which returns the load average as an - unmultiplied double. - - For backwards compatibility, we'll define LDAV_CVT in terms of - LOAD_AVE_CVT, but future machine config files should just define - LDAV_CVT directly. */ - -# if !defined (LDAV_CVT) && defined (LOAD_AVE_CVT) -# define LDAV_CVT(n) (LOAD_AVE_CVT (n) / 100.0) -# endif - # if !defined (BSD) && defined (ultrix) /* Ultrix behaves like BSD on Vaxen. */ # define BSD diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 index 029da44b4..7738d2f86 100644 --- a/m4/getloadavg.m4 +++ b/m4/getloadavg.m4 @@ -105,6 +105,8 @@ AC_DEFUN([gl_PREREQ_GETLOADAVG], [ # Figure out what our getloadavg.c needs. +AC_CHECK_HEADERS_ONCE([sys/param.h]) + # On HPUX9, an unprivileged user can get load averages this way. if test $gl_func_getloadavg_done = no; then AC_CHECK_FUNCS([pstat_getdynamic], [gl_func_getloadavg_done=yes])