]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Logging: take advantage of string folding
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 14 Aug 2016 05:23:35 +0000 (15:23 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 14 Aug 2016 05:23:35 +0000 (15:23 +1000)
qcsrc/lib/log.qh

index aa4f87cb6637f68ebaebc8414e05b039b6de63a9..7f5bc720412348f2dcc8df053027f4de84f3e1b1 100644 (file)
@@ -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) \