]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Clean up some preprocessor operations
authorPaul Smith <psmith@gnu.org>
Mon, 16 Jan 2023 18:01:09 +0000 (13:01 -0500)
committerPaul Smith <psmith@gnu.org>
Mon, 16 Jan 2023 18:01:09 +0000 (13:01 -0500)
src/arscan.c
src/commands.c
src/default.c
src/dir.c
src/main.c
src/makeint.h
src/w32/subproc/proc.h

index 1b5899bd7abc51094cb6f9182994a8b278cbb515..7ad1fbfaafc29554df63827f5ce64d5bbe90d624 100644 (file)
@@ -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 <jas1@rsvl.unisys.com>, for SCO XENIX defining
    PORTAR to 1 gets the wrong archive format, and defining it to 0 gets the
index c712178865524c1c0d4937513ea987c33e372c07..eebd63a359d2a9c9b6209779cf979c18a6cc2f98 100644 (file)
@@ -313,7 +313,7 @@ set_file_variables (struct file *file, const char *stem)
     DEFINE_VARIABLE ("|", 1, bar_value);
   }
 
-#undef  DEFINE_VARIABLE
+#undef DEFINE_VARIABLE
 }
 \f
 /* Chop CMDS up into individual command lines if necessary.
index fd12ecf93677686f0efc5495ef9854afc382912e..82b52c4be01b7e9470ddb43b23182d899fee6e92 100644 (file)
@@ -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
 
index 9a26e0318f7db9ec1957eb1c6dcb6b625e6e470a..514170bf337778acb1d98876f82fa0192a29dd37 100644 (file)
--- a/src/dir.c
+++ b/src/dir.c
@@ -20,7 +20,7 @@ this program.  If not, see <https://www.gnu.org/licenses/>.  */
 #include "dep.h"
 #include "debug.h"
 
-#ifdef  HAVE_DIRENT_H
+#ifdef HAVE_DIRENT_H
 # include <dirent.h>
 # define NAMLEN(dirent) strlen((dirent)->d_name)
 # if MK_OS_VMS
index f7d398cd11693243b1f5841a2b30ea2b8b9c3e1d..0c5d7b6705f303e93e1a07df7b826df807eee687 100644 (file)
@@ -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;
index b92b761ada5df0fd0ac188172b736fc27eccee70..d4e3fdd4eba0272e6e7e18cb77b79579b169c342 100644 (file)
@@ -49,7 +49,7 @@ this program.  If not, see <https://www.gnu.org/licenses/>.  */
 #endif
 #include "gnumake.h"
 
-#ifdef  CRAY
+#ifdef CRAY
 /* This must happen before #include <signal.h> 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 <unistd.h>
 /* 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 <vfork.h>
 #endif
 
-#ifdef  HAVE_LIMITS_H
+#ifdef HAVE_LIMITS_H
 # include <limits.h>
 #endif
-#ifdef  HAVE_SYS_PARAM_H
+#ifdef HAVE_SYS_PARAM_H
 # include <sys/param.h>
 #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 <string.h>.  */
-#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 <inttypes.h>
@@ -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
index 90c55dd9948fa3999539971da8a987af326f5b7a..94867acefa77d99da5388412828379e507163665 100644 (file)
@@ -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 <https://www.gnu.org/licenses/>.  */
 
-#ifndef  _PROC_H
+#ifndef _PROC_H
 #define _PROC_H
 
 typedef int bool_t;