Module Name:    src
Committed By:   rillig
Date:           Fri Apr 15 12:28:16 UTC 2022

Modified Files:
        src/usr.bin/make: meta.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/usr.bin/make/meta.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.199 src/usr.bin/make/meta.c:1.200
--- src/usr.bin/make/meta.c:1.199	Fri Mar  4 23:17:16 2022
+++ src/usr.bin/make/meta.c	Fri Apr 15 12:28:16 2022
@@ -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 @@ printCMDs(GNode *gn, FILE *fp)
 /*
  * 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 @@ meta_needed(GNode *gn, const char *dname
     /* 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. */

Reply via email to