From c25cd3952d455ed14214f83064298d489311b85d Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 9 Dec 2024 00:07:17 +0100 Subject: [PATCH] Fix oddity with OSX and Windows. --- util/ack/util.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/util/ack/util.c b/util/ack/util.c index bf23ff5c9..2906365a0 100644 --- a/util/ack/util.c +++ b/util/ack/util.c @@ -27,9 +27,9 @@ extern int w_flag; extern int n_error; #ifdef DEBUG -#define stdout stdout +#define OUTF stdout #else -#define stdout stderr +#define OUTF stderr #endif char* ack_basename(const char* string) @@ -91,9 +91,9 @@ void fatal(const char* fmt, ...) /* Fatal internal error */ va_list ap; va_start(ap, fmt); - fprintf(stdout, "%s: fatal internal error, ", progname); - vfprintf(stdout, fmt, ap); - fprintf(stdout, "\n"); + fprintf(OUTF, "%s: fatal internal error, ", progname); + vfprintf(OUTF, fmt, ap); + fprintf(OUTF, "\n"); quit(-2); } @@ -103,7 +103,7 @@ void vprint(const char* fmt, ...) /* Diagnostic print, no auto NL */ va_list ap; va_start(ap, fmt); - vfprintf(stdout, fmt, ap); + vfprintf(OUTF, fmt, ap); va_end(ap); } @@ -113,9 +113,9 @@ void fuerror(const char* fmt, ...) /* Fatal user error */ va_list ap; va_start(ap, fmt); - fprintf(stdout, "%s: ", progname); - vfprintf(stdout, fmt, ap); - fprintf(stdout, "\n"); + fprintf(OUTF, "%s: ", progname); + vfprintf(OUTF, fmt, ap); + fprintf(OUTF, "\n"); quit(-1); } @@ -127,9 +127,9 @@ void werror(const char* fmt, ...) if (w_flag) return; va_start(ap, fmt); - fprintf(stdout, "%s: warning, ", progname); - vfprintf(stdout, fmt, ap); - fprintf(stdout, "\n"); + fprintf(OUTF, "%s: warning, ", progname); + vfprintf(OUTF, fmt, ap); + fprintf(OUTF, "\n"); va_end(ap); } @@ -139,9 +139,9 @@ void error(const char* fmt, ...) /* User error, it is the callers responsibility to quit */ va_list ap; va_start(ap, fmt); - fprintf(stdout, "%s: ", progname); - vfprintf(stdout, fmt, ap); - fprintf(stdout, "\n"); + fprintf(OUTF, "%s: ", progname); + vfprintf(OUTF, fmt, ap); + fprintf(OUTF, "\n"); n_error++; va_end(ap); }