From bfbc3ce20cdcfd00c27922c2e78cbff43846fe0d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 15 Mar 1998 11:09:10 +0000 Subject: Use #if, not #ifdef with HAVE_ macros --- lib/chown.c | 2 +- lib/closeout.c | 2 +- lib/dirname.c | 2 +- lib/euidaccess.c | 4 ++-- lib/fileblocks.c | 2 +- lib/filemode.c | 46 +++++++++++++++++++++++----------------------- lib/ftruncate.c | 32 ++++++++++++++++---------------- lib/group-member.c | 8 ++++---- lib/isdir.c | 10 +++++----- lib/long-options.c | 2 +- lib/mountlist.c | 8 ++++---- lib/path-concat.c | 6 +++--- lib/save-cwd.c | 10 +++++----- lib/savedir.c | 6 +++--- lib/strdup.c | 10 +++++----- lib/userspec.c | 4 ++-- lib/yesno.c | 8 ++++---- 17 files changed, 81 insertions(+), 81 deletions(-) (limited to 'lib') diff --git a/lib/chown.c b/lib/chown.c index dc351d28c..63b89c27e 100644 --- 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 index a6fbbf719..a4a986fa3 100644 --- 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 index 7cc104095..56b66e65c 100644 --- 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 index 4e032a911..4109d993c 100644 --- a/lib/euidaccess.c +++ b/lib/euidaccess.c @@ -21,7 +21,7 @@ Suite 330, Boston, MA 02111-1307, USA. */ /* 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 @@ static gid_t egid; /* 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 index e94d903b0..0c182d8e0 100644 --- 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 index 91373de34..d87af5bea 100644 --- 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 index 1272ee74f..d4c129a18 100644 --- 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 @@ ftruncate (fd, length) } #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 @@ ftruncate (fd, length) 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 @@ ftruncate (fd, length) 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 @@ ftruncate (fd, length) 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 index 065f4d8bb..dee0c39f0 100644 --- 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 @@ struct group_info 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 index 428334633..f653fafc9 100644 --- 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 index 40c1a0db3..4d216abd3 100644 --- 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 index 5018745a0..68a07cb7c 100644 --- 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 *xrealloc (); char *xstrdup (); void error (); -#ifdef HAVE_SYS_PARAM_H +#if HAVE_SYS_PARAM_H # include #endif @@ -101,7 +101,7 @@ void error (); # 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 index b0c18a8c5..abafd31ee 100644 --- 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 index 31b46ce48..40bd70b0d 100644 --- 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 @@ save_cwd (cwd) 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 index 523e94e0e..5a9c339d8 100644 --- 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 index 7b73a50c2..4f6bb83e5 100644 --- 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 index bf51778d7..e73bee9c0 100644 --- 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 index 44c437caf..8aaaf3d4b 100644 --- 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 -- cgit v1.2.3-54-g00ecf