From 22ffb97351d1081558c070a3c134d2be99993df6 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 10 Jul 2012 17:01:21 -0700 Subject: [PATCH] Remove "#define unix" that is no longer needed (Bug#11905). Merge from gnulib to make "#define unix" unnecessary, incorporating: 2012-07-10 getloadavg: clean out old Emacs and Autoconf cruft 2012-07-09 getopt: Simplify after Emacs changed. * src/s/aix4-2.h (unix): Remove; no longer needed. --- ChangeLog | 7 +++++++ lib/getloadavg.c | 28 +++------------------------- m4/getloadavg.m4 | 2 ++ m4/getopt.m4 | 15 ++++----------- src/ChangeLog | 3 +++ src/s/aix4-2.h | 3 --- 6 files changed, 19 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3b546d32f4..4fbb293747d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-07-10 Paul Eggert + + Remove "#define unix" that is no longer needed (Bug#11905). + Merge from gnulib to make "#define unix" unnecessary, incorporating: + 2012-07-10 getloadavg: clean out old Emacs and Autoconf cruft + 2012-07-09 getopt: Simplify after Emacs changed. + 2012-07-10 Glenn Morris * configure.ac (DATA_START, DATA_SEG_BITS, PENDING_OUTPUT_COUNT): diff --git a/lib/getloadavg.c b/lib/getloadavg.c index 79ea71787ac..a8ffefee33f 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 029da44b497..7738d2f8669 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]) diff --git a/m4/getopt.m4 b/m4/getopt.m4 index 155edb235ff..f6902b58591 100644 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 @@ -1,4 +1,4 @@ -# getopt.m4 serial 43 +# getopt.m4 serial 44 dnl Copyright (C) 2002-2006, 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,18 +9,17 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX], [ m4_divert_text([DEFAULTS], [gl_getopt_required=POSIX]) AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) dnl Other modules can request the gnulib implementation of the getopt dnl functions unconditionally, by defining gl_REPLACE_GETOPT_ALWAYS. dnl argp.m4 does this. m4_ifdef([gl_REPLACE_GETOPT_ALWAYS], [ - gl_GETOPT_IFELSE([], []) REPLACE_GETOPT=1 ], [ REPLACE_GETOPT=0 - gl_GETOPT_IFELSE([ + if test -n "$gl_replace_getopt"; then REPLACE_GETOPT=1 - ], - []) + fi ]) if test $REPLACE_GETOPT = 1; then dnl Arrange for getopt.h to be created. @@ -38,12 +37,6 @@ AC_DEFUN([gl_FUNC_GETOPT_GNU], AC_REQUIRE([gl_FUNC_GETOPT_POSIX]) ]) -AC_DEFUN([gl_GETOPT_IFELSE], -[ - AC_REQUIRE([gl_GETOPT_CHECK_HEADERS]) - AS_IF([test -n "$gl_replace_getopt"], [$1], [$2]) -]) - # Determine whether to replace the entire getopt facility. AC_DEFUN([gl_GETOPT_CHECK_HEADERS], [ diff --git a/src/ChangeLog b/src/ChangeLog index de56d4160a7..0c98c0b356d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2012-07-10 Paul Eggert + Remove "#define unix" that is no longer needed (Bug#11905). + * s/aix4-2.h (unix): Remove; no longer needed. + EMACS_TIME simplification (Bug#11875). This replaces macros (which typically do not work in GDB) with functions, typedefs and enums, making the code easier to debug. diff --git a/src/s/aix4-2.h b/src/s/aix4-2.h index 51ac9748f27..b7bdc8739a7 100644 --- a/src/s/aix4-2.h +++ b/src/s/aix4-2.h @@ -40,9 +40,6 @@ along with GNU Emacs. If not, see . */ /* Special items needed to make Emacs run on this system. */ -/* AIX doesn't define this. */ -#define unix 1 - /* Perry Smith says these are correct. */ #define SIGNALS_VIA_CHARACTERS #define CLASH_DETECTION -- 2.39.2