From ea56110b8628c08bfad4217e418598220ec2a41e Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 5 Feb 2019 23:06:26 +0100 Subject: [PATCH] Make use of a function to reduce compilation output and globals (particularly for the server: qc -130KB, dat -70KB, -206 globals) --- qcsrc/common/mutators/base.qh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/mutators/base.qh b/qcsrc/common/mutators/base.qh index b9a69caf93..c1d658576e 100644 --- a/qcsrc/common/mutators/base.qh +++ b/qcsrc/common/mutators/base.qh @@ -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; \ } \ } \ -- 2.39.2