From 8285852e553429021526d1a686fff290a5d469ef Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 16 Jan 2023 13:01:09 -0500 Subject: Clean up some preprocessor operations --- src/arscan.c | 6 +++--- src/commands.c | 2 +- src/default.c | 14 +++++++------- src/dir.c | 2 +- src/main.c | 18 ++++++++---------- src/makeint.h | 18 +++++++++--------- src/w32/subproc/proc.h | 2 +- 7 files changed, 30 insertions(+), 32 deletions(-) diff --git a/src/arscan.c b/src/arscan.c index 1b5899bd..7ad1fbfa 100644 --- a/src/arscan.c +++ b/src/arscan.c @@ -292,8 +292,8 @@ ar_scan (const char *archive, ar_member_func_t function, const void *varg) #else /* !MK_OS_VMS */ /* SCO Unix's compiler defines both of these. */ -#ifdef M_UNIX -#undef M_XENIX +#ifdef M_UNIX +#undef M_XENIX #endif /* On the sun386i and in System V rel 3, ar.h defines two different archive @@ -302,7 +302,7 @@ ar_scan (const char *archive, ar_member_func_t function, const void *varg) to have a nonzero value. */ #if (!defined (PORTAR) || PORTAR == 0) && (!defined (PORT5AR) || PORT5AR == 0) -#undef PORTAR +#undef PORTAR #ifdef M_XENIX /* According to Jim Sievert , for SCO XENIX defining PORTAR to 1 gets the wrong archive format, and defining it to 0 gets the diff --git a/src/commands.c b/src/commands.c index c7121788..eebd63a3 100644 --- a/src/commands.c +++ b/src/commands.c @@ -313,7 +313,7 @@ set_file_variables (struct file *file, const char *stem) DEFINE_VARIABLE ("|", 1, bar_value); } -#undef DEFINE_VARIABLE +#undef DEFINE_VARIABLE } /* Chop CMDS up into individual command lines if necessary. diff --git a/src/default.c b/src/default.c index fd12ecf9..82b52c4b 100644 --- a/src/default.c +++ b/src/default.c @@ -552,17 +552,17 @@ static const char *default_variables[] = "COFLAGS", "", "CPP", "$(CC) -E", -#ifdef CRAY +#ifdef CRAY "CF77PPFLAGS", "-P", "CF77PP", "/lib/cpp", "CFT", "cft77", "CF", "cf77", "FC", "$(CF)", -#else /* Not CRAY. */ -#ifdef _IBMR2 +#else /* Not CRAY. */ +#ifdef _IBMR2 "FC", "xlf", #else -#ifdef __convex__ +#ifdef __convex__ "FC", "fc", #else "FC", "f77", @@ -582,10 +582,10 @@ static const char *default_variables[] = #endif "LINT", "lint", "M2C", "m2c", -#ifdef pyr +#ifdef pyr "PC", "pascal", #else -#ifdef CRAY +#ifdef CRAY "PC", "PASCAL", "SEGLDR", "segldr", #else @@ -656,7 +656,7 @@ static const char *default_variables[] = "OUTPUT_OPTION", "-o $@", #endif -#ifdef SCCS_GET_MINUS_G +#ifdef SCCS_GET_MINUS_G "SCCS_OUTPUT_OPTION", "-G$@", #endif diff --git a/src/dir.c b/src/dir.c index 9a26e031..514170bf 100644 --- a/src/dir.c +++ b/src/dir.c @@ -20,7 +20,7 @@ this program. If not, see . */ #include "dep.h" #include "debug.h" -#ifdef HAVE_DIRENT_H +#ifdef HAVE_DIRENT_H # include # define NAMLEN(dirent) strlen((dirent)->d_name) # if MK_OS_VMS diff --git a/src/main.c b/src/main.c index f7d398cd..0c5d7b67 100644 --- a/src/main.c +++ b/src/main.c @@ -1241,11 +1241,11 @@ main (int argc, char **argv, char **envp) (void)bindtextdomain (PACKAGE, LOCALEDIR); (void)textdomain (PACKAGE); -#ifdef POSIX +#ifdef POSIX sigemptyset (&fatal_signal_set); #define ADD_SIG(sig) sigaddset (&fatal_signal_set, sig) #else -#ifdef HAVE_SIGSETMASK +#ifdef HAVE_SIGSETMASK fatal_signal_mask = 0; #define ADD_SIG(sig) fatal_signal_mask |= sigmask (sig) #else @@ -1278,7 +1278,7 @@ main (int argc, char **argv, char **envp) FATAL_SIG (SIGFPE); #endif -#ifdef SIGDANGER +#ifdef SIGDANGER FATAL_SIG (SIGDANGER); #endif #ifdef SIGXCPU @@ -1288,7 +1288,7 @@ main (int argc, char **argv, char **envp) FATAL_SIG (SIGXFSZ); #endif -#undef FATAL_SIG +#undef FATAL_SIG /* Do not ignore the child-death signal. This must be done before any children could possibly be created; otherwise, the wait @@ -1405,7 +1405,7 @@ main (int argc, char **argv, char **envp) if (getcwd (current_directory, GET_PATH_MAX) == 0) #endif { -#ifdef HAVE_GETCWD +#ifdef HAVE_GETCWD perror_with_name ("getcwd", ""); #else OS (error, NILF, "getwd: %s", current_directory); @@ -1693,8 +1693,7 @@ main (int argc, char **argv, char **envp) if (strpbrk (argv[0], "/:\\") || strstr (argv[0], "..") || strneq (argv[0], "//", 2)) argv[0] = xstrdup (w32ify (argv[0], 1)); -#else /* MK_OS_W32 */ -#if MK_OS_DOS || MK_OS_OS2 +#elif MK_OS_DOS || MK_OS_OS2 if (strchr (argv[0], '\\')) { char *p; @@ -1727,7 +1726,6 @@ main (int argc, char **argv, char **envp) argv[0] = xstrdup (concat (3, current_directory, "/", argv[0])); #endif /* !MK_OS_DOS */ #endif /* MK_OS_W32 */ -#endif /* We may move, but until we do, here we are. */ starting_directory = current_directory; @@ -1776,7 +1774,7 @@ main (int argc, char **argv, char **envp) if (getcwd (current_directory, GET_PATH_MAX) == 0) #endif { -#ifdef HAVE_GETCWD +#ifdef HAVE_GETCWD perror_with_name ("getcwd", ""); #else OS (error, NILF, "getwd: %s", current_directory); @@ -3531,7 +3529,7 @@ define_makeflags (int makefile) abort (); } -#undef ADD_FLAG +#undef ADD_FLAG /* Four more for the possible " -- ", plus variable references. */ flagslen += 4 + CSTRLEN (posixref) + 4 + CSTRLEN (evalref) + 4; diff --git a/src/makeint.h b/src/makeint.h index b92b761a..d4e3fdd4 100644 --- a/src/makeint.h +++ b/src/makeint.h @@ -49,7 +49,7 @@ this program. If not, see . */ #endif #include "gnumake.h" -#ifdef CRAY +#ifdef CRAY /* This must happen before #include so that the declaration therein is changed. */ # define signal bsdsignal @@ -107,7 +107,7 @@ extern int errno; # endif #endif -#ifdef HAVE_UNISTD_H +#ifdef HAVE_UNISTD_H # include /* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get POSIX.1 behavior with 'cc -YPOSIX', which predefines POSIX itself! */ @@ -137,10 +137,10 @@ extern int errno; # include #endif -#ifdef HAVE_LIMITS_H +#ifdef HAVE_LIMITS_H # include #endif -#ifdef HAVE_SYS_PARAM_H +#ifdef HAVE_SYS_PARAM_H # include #endif @@ -154,7 +154,7 @@ extern int errno; # endif #endif -#ifdef PATH_MAX +#ifdef PATH_MAX # define GET_PATH_MAX PATH_MAX # define PATH_VAR(var) char var[PATH_MAX+1] #else @@ -269,16 +269,16 @@ void exit (int) NORETURN; # define EXIT_FAILURE 1 #endif -#ifndef ANSI_STRING +#ifndef ANSI_STRING /* SCO Xenix has a buggy macro definition in . */ -#undef strerror +#undef strerror #if !defined(__DECC) char *strerror (int errnum); #endif #endif /* !ANSI_STRING. */ -#undef ANSI_STRING +#undef ANSI_STRING #if HAVE_INTTYPES_H # include @@ -691,7 +691,7 @@ void dbg (const char *fmt, ...); long int lseek (); # endif -# ifdef HAVE_GETCWD +# ifdef HAVE_GETCWD # if !MK_OS_VMS && !defined(__DECC) char *getcwd (void); # endif diff --git a/src/w32/subproc/proc.h b/src/w32/subproc/proc.h index 90c55dd9..94867ace 100644 --- a/src/w32/subproc/proc.h +++ b/src/w32/subproc/proc.h @@ -14,7 +14,7 @@ A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _PROC_H +#ifndef _PROC_H #define _PROC_H typedef int bool_t; -- cgit v1.2.1