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: do not use __CONCAT and __STRING in meta_...



details:   https://anonhg.NetBSD.org/src/rev/7672f0f3f349
branches:  trunk
changeset: 365222:7672f0f3f349
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Apr 15 12:28:16 2022 +0000

description:
make: do not use __CONCAT and __STRING in meta_needed

Using __CONCAT for identifiers makes it impossible to find their usages
easily, as could be seen in targ.c 1.22 from 2001-07-03.  It also
requires that the parts of the identifier are not macros themselves.

No binary change.

diffstat:

 usr.bin/make/meta.c |  20 +++++++++-----------
 1 files changed, 9 insertions(+), 11 deletions(-)

diffs (43 lines):

diff -r e873fcd0c4dc -r 7672f0f3f349 usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Fri Apr 15 12:19:28 2022 +0000
+++ b/usr.bin/make/meta.c       Fri Apr 15 12:28:16 2022 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.199 2022/03/04 23:17:16 sjg Exp $ */
+/*      $NetBSD: meta.c,v 1.200 2022/04/15 12:28:16 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -380,12 +380,10 @@
 /*
  * Certain node types never get a .meta file
  */
-#define SKIP_META_TYPE(_type) do { \
-    if ((gn->type & __CONCAT(OP_, _type))) { \
-       if (verbose) { \
-           debug_printf("Skipping meta for %s: .%s\n", \
-                   gn->name, __STRING(_type)); \
-       } \
+#define SKIP_META_TYPE(flag, str) do { \
+    if ((gn->type & (flag))) { \
+       if (verbose) \
+           debug_printf("Skipping meta for %s: .%s\n", gn->name, str); \
        return false; \
     } \
 } while (false)
@@ -406,12 +404,12 @@
     /* This may be a phony node which we don't want meta data for... */
     /* Skip .meta for .BEGIN, .END, .ERROR etc as well. */
     /* Or it may be explicitly flagged as .NOMETA */
-    SKIP_META_TYPE(NOMETA);
+    SKIP_META_TYPE(OP_NOMETA, "NOMETA");
     /* Unless it is explicitly flagged as .META */
     if (!(gn->type & OP_META)) {
-       SKIP_META_TYPE(PHONY);
-       SKIP_META_TYPE(SPECIAL);
-       SKIP_META_TYPE(MAKE);
+       SKIP_META_TYPE(OP_PHONY, "PHONY");
+       SKIP_META_TYPE(OP_SPECIAL, "SPECIAL");
+       SKIP_META_TYPE(OP_MAKE, "MAKE");
     }
 
     /* Check if there are no commands to execute. */



Home | Main Index | Thread Index | Old Index