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 b9a69ca..c1d6585 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; \
         } \
     } \