summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/make.h
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-09-17 22:31:26 +0000
committerjmallett <jmallett@FreeBSD.org>2002-09-17 22:31:26 +0000
commit7fd8427cf78ed3d6ed80aafb4dd8b2ae5c85715b (patch)
treee9bbc739d9ad215c67355ae9b0a1a298016a17b9 /usr.bin/make/make.h
parent086f36bd966184831309cca6a2187aa38f6b0393 (diff)
downloadFreeBSD-src-7fd8427cf78ed3d6ed80aafb4dd8b2ae5c85715b.zip
FreeBSD-src-7fd8427cf78ed3d6ed80aafb4dd8b2ae5c85715b.tar.gz
Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), using
variable length arguments to a macro. Bump version as this makes DEBUG statements *always* go to stderr rather than sometimes stdout. There are a few stragglers, which I will take care of as soon as I can. Mostly these relate to the need-for-death-of some of the remote job code. Nearby stylistic nits and XXX added/fixed where appropriate.
Diffstat (limited to 'usr.bin/make/make.h')
-rw-r--r--usr.bin/make/make.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h
index 465ee38..6976a89 100644
--- a/usr.bin/make/make.h
+++ b/usr.bin/make/make.h
@@ -338,6 +338,13 @@ extern int debug;
#define CONCAT(a,b) a##b
#define DEBUG(module) (debug & CONCAT(DEBUG_,module))
+#define DEBUGF(module,fmt,args...) \
+do { \
+ if (DEBUG(module)) { \
+ fprintf(stderr, fmt, ##args); \
+ fflush(stderr); \
+ } \
+} while (0)
#define ISDOT(c) ((c)[0] == '.' && (((c)[1] == '\0') || ((c)[1] == '/')))
#define ISDOTDOT(c) ((c)[0] == '.' && ISDOT(&((c)[1])))
OpenPOWER on IntegriCloud