]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make use of a function to reduce compilation output and globals (particularly for...
authorterencehill <piuntn@gmail.com>
Tue, 5 Feb 2019 22:06:26 +0000 (23:06 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 5 Feb 2019 22:10:02 +0000 (23:10 +0100)
qcsrc/common/mutators/base.qh

index b9a69caf93ea75990fe7c50b2640c62d74d9de13..c1d658576e2cb4b22e43a7e6446356312467265f 100644 (file)
@@ -318,10 +318,16 @@ MACRO_END
     bool mut##_##cb() { return = false; } \
     ACCUMULATE bool mut##_##cb()
 
+void _mutPrintFail(string cb, string func)
+{
+       // this is inside a function to avoid expanding it on compilation everytime
+       LOG_INFO("HOOK FAILED: ", cb, ":", func);
+}
+
 #define MUTATOR_HOOK(cb, func, order) MACRO_BEGIN \
     MUTATOR_ONADD { \
         if (!CallbackChain_Add(HOOK_##cb, CB_##func, order)) { \
-            LOG_INFO("HOOK FAILED: ", #cb, ":", #func); \
+            _mutPrintFail(#cb, #func); \
             return true; \
         } \
     } \