From db99cbb0dcba82decf8b1843ae32489ed6a1d732 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 14 Aug 2016 15:23:35 +1000 Subject: [PATCH] Logging: take advantage of string folding --- qcsrc/lib/log.qh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qcsrc/lib/log.qh b/qcsrc/lib/log.qh index aa4f87cb6..7f5bc7204 100644 --- a/qcsrc/lib/log.qh +++ b/qcsrc/lib/log.qh @@ -39,7 +39,12 @@ string(string, string...) strcat1n = #115; #endif // would be nice if __FUNC__ could be concatenated at compile time -#define __SOURCELOC__ (sprintf("^7%s^9" "(" "^9"__FILE__"^7" ":" "^9"STR(__LINE__)"^7" ")", __FUNC__)) +#if 0 + // less work, bigger binary + #define __SOURCELOC__ (sprintf("^7%s^9" "(" "^9"__FILE__"^7" ":" "^9"STR(__LINE__)"^7" ")", __FUNC__)) +#else + #define __SOURCELOC__ (sprintf("^7%s^9" "(" "^9%s^7" ":" "^9%s^7" ")", __FUNC__, __FILE__, STR(__LINE__))) +#endif #define _LOG_HEADER(level) "^9[::" "^7"PROGNAME"^9" "::" level"^9" "] ", __SOURCELOC__ #define _LOG(f, level, s) \ -- 2.39.2