aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/singlejar/diag.h
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2018-03-09 02:11:23 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-09 02:13:32 -0800
commitc14b3c6bc56a0b66d2e64f8fe7ba641119e478ae (patch)
tree18145cf2e931de279a80a2e7c82f82c969ca30d3 /src/tools/singlejar/diag.h
parent9dac6736d811895a23b976d0af461cefd09afcd1 (diff)
Internal change
PiperOrigin-RevId: 188459395
Diffstat (limited to 'src/tools/singlejar/diag.h')
-rw-r--r--src/tools/singlejar/diag.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/tools/singlejar/diag.h b/src/tools/singlejar/diag.h
index 775ab05344..cae255f15f 100644
--- a/src/tools/singlejar/diag.h
+++ b/src/tools/singlejar/diag.h
@@ -33,16 +33,18 @@
#include <string.h>
#include <windows.h>
#define _diag_msg(prefix, msg, ...) \
- { fprintf(stderr, prefix " [" __FILE__ ":%d]" msg, __LINE__, __VA_ARGS__); }
-#define _diag_msgx(eval, prefix, msg, ...) \
- { \
- _diag_msg(prefix, msg, __VA_ARGS__); \
- ::ExitProcess(eval); \
+ { fprintf(stderr, prefix msg, __VA_ARGS__); }
+#define _diag_msgx(exit_value, prefix, msg, ...) \
+ { \
+ _diag_msg(prefix, msg, __VA_ARGS__); \
+ ::ExitProcess(exit_value); \
}
-#define diag_err(eval, fmt, ...) _diag_msgx(eval, "ERROR", fmt, __VA_ARGS__)
-#define diag_errx(eval, ...) _diag_msgx(eval, "ERROR", "", __VA_ARGS__)
-#define diag_warn(...) _diag_msg("WARNING", __VA_ARGS__)
-#define diag_warnx(...) _diag_msg("WARNING")
+#define diag_err(exit_value, fmt, ...) \
+ _diag_msgx(exit_value, "ERROR: ", fmt, __VA_ARGS__)
+#define diag_errx(exit_value, fmt, ...) \
+ _diag_msgx(exit_value, "ERROR: ", fmt, __VA_ARGS__)
+#define diag_warn(fmt, ...) _diag_msg("WARNING: ", fmt, __VA_ARGS__)
+#define diag_warnx(fmt, ...) _diag_msg("WARNING: ", fmt, __VA_ARGS__)
#else
#error Unknown platform