# HG changeset patch # User Jim Meyering # Date 889960150 0 # Node ID 9ad625a30b7de4be639c80f4ff1c686d3171d4b7 # Parent f44ecdf8019753e0134cbfcd8448bc881007ef71 Use #if, not #ifdef with HAVE_ macros diff --git a/lib/chown.c b/lib/chown.c --- a/lib/chown.c +++ b/lib/chown.c @@ -27,7 +27,7 @@ #include #include -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif diff --git a/lib/closeout.c b/lib/closeout.c --- a/lib/closeout.c +++ b/lib/closeout.c @@ -26,7 +26,7 @@ # define _(Text) Text #endif -#ifdef HAVE_STDLIB_H +#if HAVE_STDLIB_H # include #endif #ifndef EXIT_FAILURE diff --git a/lib/dirname.c b/lib/dirname.c --- a/lib/dirname.c +++ b/lib/dirname.c @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif diff --git a/lib/euidaccess.c b/lib/euidaccess.c --- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -21,7 +21,7 @@ /* Written by David MacKenzie and Torbjorn Granlund. Adapted for GNU C library by Roland McGrath. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif @@ -111,7 +111,7 @@ /* Nonzero if UID, GID, EUID, and EGID have valid values. */ static int have_ids = 0; -# ifdef HAVE_GETGROUPS +# if HAVE_GETGROUPS int group_member (); # else # define group_member(gid) 0 diff --git a/lib/fileblocks.c b/lib/fileblocks.c --- a/lib/fileblocks.c +++ b/lib/fileblocks.c @@ -17,7 +17,7 @@ /* Written by Brian L. Matthews, blm@6sceng.UUCP. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif diff --git a/lib/filemode.c b/lib/filemode.c --- a/lib/filemode.c +++ b/lib/filemode.c @@ -1,5 +1,5 @@ /* filemode.c -- make a string describing file modes - Copyright (C) 1985, 1990, 1993 Free Software Foundation, Inc. + Copyright (C) 1985, 1990, 1993, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,8 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H -#include +#if HAVE_CONFIG_H +# include #endif #include @@ -47,45 +47,45 @@ #endif #ifdef STAT_MACROS_BROKEN -#undef S_ISBLK -#undef S_ISCHR -#undef S_ISDIR -#undef S_ISFIFO -#undef S_ISLNK -#undef S_ISMPB -#undef S_ISMPC -#undef S_ISNWK -#undef S_ISREG -#undef S_ISSOCK +# undef S_ISBLK +# undef S_ISCHR +# undef S_ISDIR +# undef S_ISFIFO +# undef S_ISLNK +# undef S_ISMPB +# undef S_ISMPC +# undef S_ISNWK +# undef S_ISREG +# undef S_ISSOCK #endif /* STAT_MACROS_BROKEN. */ #if !defined(S_ISBLK) && defined(S_IFBLK) -#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) #endif #if !defined(S_ISCHR) && defined(S_IFCHR) -#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) #endif #if !defined(S_ISDIR) && defined(S_IFDIR) -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif #if !defined(S_ISREG) && defined(S_IFREG) -#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif #if !defined(S_ISFIFO) && defined(S_IFIFO) -#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) #endif #if !defined(S_ISLNK) && defined(S_IFLNK) -#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) #endif #if !defined(S_ISSOCK) && defined(S_IFSOCK) -#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) #endif #if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */ -#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) -#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) +# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) +# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) #endif #if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */ -#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) +# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) #endif void mode_string (); diff --git a/lib/ftruncate.c b/lib/ftruncate.c --- a/lib/ftruncate.c +++ b/lib/ftruncate.c @@ -1,8 +1,8 @@ /* ftruncate emulations that work on some System V's. This file is in the public domain. */ -#ifdef HAVE_CONFIG_H -#include +#if HAVE_CONFIG_H +# include #endif #include @@ -19,15 +19,15 @@ } #else /* not F_CHSIZE */ -#ifdef F_FREESP +# ifdef F_FREESP /* By William Kucharski . */ -#include -#include -#ifdef HAVE_UNISTD_H -#include -#endif +# include +# include +# if HAVE_UNISTD_H +# include +# endif int ftruncate (fd, length) @@ -71,8 +71,8 @@ return 0; } -#else /* not F_CHSIZE nor F_FREESP */ -#ifdef HAVE_CHSIZE +# else /* not F_CHSIZE nor F_FREESP */ +# if HAVE_CHSIZE int ftruncate (fd, length) @@ -82,12 +82,12 @@ return chsize (fd, length); } -#else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */ +# else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */ -#include -#ifndef errno +# include +# ifndef errno extern int errno; -#endif +# endif int ftruncate (fd, length) @@ -98,6 +98,6 @@ return -1; } -#endif /* not HAVE_CHSIZE */ -#endif /* not F_FREESP */ +# endif /* not HAVE_CHSIZE */ +# endif /* not F_FREESP */ #endif /* not F_CHSIZE */ diff --git a/lib/group-member.c b/lib/group-member.c --- a/lib/group-member.c +++ b/lib/group-member.c @@ -1,5 +1,5 @@ /* group-member.c -- determine whether group id is in calling user's group list - Copyright (C) 1994, 1997 Free Software Foundation, Inc. + Copyright (C) 1994, 1997, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif @@ -26,7 +26,7 @@ # include #endif -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif @@ -41,7 +41,7 @@ GETGROUPS_T *group; }; -#ifdef HAVE_GETGROUPS +#if HAVE_GETGROUPS static void free_group_info (struct group_info *g) diff --git a/lib/isdir.c b/lib/isdir.c --- a/lib/isdir.c +++ b/lib/isdir.c @@ -1,5 +1,5 @@ /* isdir.c -- determine whether a directory exists - Copyright (C) 1990 Free Software Foundation, Inc. + Copyright (C) 1990, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,19 +15,19 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H -#include +#if HAVE_CONFIG_H +# include #endif #include #include #ifdef STAT_MACROS_BROKEN -#undef S_ISDIR +# undef S_ISDIR #endif /* STAT_MACROS_BROKEN. */ #if !defined(S_ISDIR) && defined(S_IFDIR) -#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif /* If PATH is an existing directory or symbolic link to a directory, diff --git a/lib/long-options.c b/lib/long-options.c --- a/lib/long-options.c +++ b/lib/long-options.c @@ -17,7 +17,7 @@ /* Written by Jim Meyering. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif diff --git a/lib/mountlist.c b/lib/mountlist.c --- a/lib/mountlist.c +++ b/lib/mountlist.c @@ -1,5 +1,5 @@ /* mountlist.c -- return a list of mounted filesystems - Copyright (C) 1991, 1992, 1997 Free Software Foundation, Inc. + Copyright (C) 1991, 1992, 1997, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif @@ -42,7 +42,7 @@ char *xstrdup (); void error (); -#ifdef HAVE_SYS_PARAM_H +#if HAVE_SYS_PARAM_H # include #endif @@ -101,7 +101,7 @@ # define MOUNTED_GETMNTTBL #endif -#ifdef HAVE_SYS_MNTENT_H +#if HAVE_SYS_MNTENT_H /* This is to get MNTOPT_IGNORE on e.g. SVR4. */ # include #endif diff --git a/lib/path-concat.c b/lib/path-concat.c --- a/lib/path-concat.c +++ b/lib/path-concat.c @@ -1,5 +1,5 @@ /* path-concat.c -- concatenate two arbitrary pathnames - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ /* Written by Jim Meyering. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif @@ -26,7 +26,7 @@ #endif #include -#ifdef HAVE_STRING_H +#if HAVE_STRING_H # include #endif #include diff --git a/lib/save-cwd.c b/lib/save-cwd.c --- a/lib/save-cwd.c +++ b/lib/save-cwd.c @@ -1,5 +1,5 @@ /* save-cwd.c -- Save and restore current working directory. - Copyright (C) 1995, 1997 Free Software Foundation, Inc. + Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ /* Written by Jim Meyering . */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include "config.h" #endif @@ -27,11 +27,11 @@ # include #endif -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif -#ifdef HAVE_FCNTL_H +#if HAVE_FCNTL_H # include #else # include @@ -67,7 +67,7 @@ if (have_working_fchdir) { -#ifdef HAVE_FCHDIR +#if HAVE_FCHDIR cwd->desc = open (".", O_RDONLY); if (cwd->desc < 0) { diff --git a/lib/savedir.c b/lib/savedir.c --- a/lib/savedir.c +++ b/lib/savedir.c @@ -1,5 +1,5 @@ /* savedir.c -- save the list of files in a directory in a string - Copyright (C) 1990, 1997 Free Software Foundation, Inc. + Copyright (C) 1990, 1997, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,13 +17,13 @@ /* Written by David MacKenzie . */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H # include #endif #include -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif diff --git a/lib/strdup.c b/lib/strdup.c --- a/lib/strdup.c +++ b/lib/strdup.c @@ -1,5 +1,5 @@ /* strdup.c -- return a newly allocated copy of a string - Copyright (C) 1990 Free Software Foundation, Inc. + Copyright (C) 1990, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,13 +15,13 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H -#include +#if HAVE_CONFIG_H +# include #endif #ifdef STDC_HEADERS -#include -#include +# include +# include #else char *malloc (); char *strcpy (); diff --git a/lib/userspec.c b/lib/userspec.c --- a/lib/userspec.c +++ b/lib/userspec.c @@ -1,5 +1,5 @@ /* userspec.c -- Parse a user and group string. - Copyright (C) 1989, 1990, 1991, 1992, 1997 Free Software Foundation, Inc. + Copyright (C) 1989, 1990, 1991, 1992, 1997, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +24,7 @@ #ifdef __GNUC__ # define alloca __builtin_alloca #else -# ifdef HAVE_ALLOCA_H +# if HAVE_ALLOCA_H # include # else # ifdef _AIX diff --git a/lib/yesno.c b/lib/yesno.c --- a/lib/yesno.c +++ b/lib/yesno.c @@ -1,5 +1,5 @@ /* yesno.c -- read a yes/no response from stdin - Copyright (C) 1990 Free Software Foundation, Inc. + Copyright (C) 1990, 1998 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,12 +15,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HAVE_CONFIG_H -#include +#if HAVE_CONFIG_H +# include #endif #include -#ifdef HAVE_STDLIB_H +#if HAVE_STDLIB_H # include #endif #include