Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make make(1): fix MAKE_RCSID for lint mode



details:   https://anonhg.NetBSD.org/src/rev/6674c4243b66
branches:  trunk
changeset: 948276:6674c4243b66
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 23 14:03:13 2020 +0000

description:
make(1): fix MAKE_RCSID for lint mode

Previously, running lint mode didn't define MAKE_RCSID at all, which
resulted in a syntax error.

While here, reduced the indentation and nesting of the preprocessor
directives.

diffstat:

 usr.bin/make/make.h |  22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diffs (38 lines):

diff -r 6bb666bd15fa -r 6674c4243b66 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Wed Dec 23 13:50:54 2020 +0000
+++ b/usr.bin/make/make.h       Wed Dec 23 14:03:13 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.237 2020/12/23 13:50:54 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.238 2020/12/23 14:03:13 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -831,19 +831,17 @@
                (*pp)++;
 }
 
-#ifdef MAKE_NATIVE
+#if defined(lint)
+#  define MAKE_RCSID(id) extern void do_not_define_rcsid(void)
+#elif defined(MAKE_NATIVE)
 #  include <sys/cdefs.h>
-#  ifndef lint
-#    define MAKE_RCSID(id) __RCSID(id)
-#  endif
+#  define MAKE_RCSID(id) __RCSID(id)
+#elif defined(MAKE_ALL_IN_ONE) && defined(__COUNTER__)
+#  define MAKE_RCSID_CONCAT(x, y) CONCAT(x, y)
+#  define MAKE_RCSID(id) static volatile char \
+       MAKE_RCSID_CONCAT(rcsid_, __COUNTER__)[] = id
 #elif defined(MAKE_ALL_IN_ONE)
-#  if defined(__COUNTER__)
-#    define MAKE_RCSID_CONCAT(x, y) CONCAT(x, y)
-#    define MAKE_RCSID(id) static volatile char \
-       MAKE_RCSID_CONCAT(rcsid_, __COUNTER__)[] = id
-#  else
-#    define MAKE_RCSID(id) extern void do_not_define_rcsid(void)
-#  endif
+#  define MAKE_RCSID(id) extern void do_not_define_rcsid(void)
 #else
 #  define MAKE_RCSID(id) static volatile char rcsid[] = id
 #endif



Home | Main Index | Thread Index | Old Index