From: TimePath Date: Sun, 14 Aug 2016 05:23:35 +0000 (+1000) Subject: Logging: take advantage of string folding X-Git-Tag: xonotic-v0.8.2~721 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=db99cbb0dcba82decf8b1843ae32489ed6a1d732;p=xonotic%2Fxonotic-data.pk3dir.git Logging: take advantage of string folding --- 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) \