From: terencehill Date: Tue, 5 Feb 2019 22:06:26 +0000 (+0100) Subject: Make use of a function to reduce compilation output and globals (particularly for... X-Git-Tag: xonotic-v0.8.5~1604^2~13 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ea56110b8628c08bfad4217e418598220ec2a41e;p=xonotic%2Fxonotic-data.pk3dir.git Make use of a function to reduce compilation output and globals (particularly for the server: qc -130KB, dat -70KB, -206 globals) --- diff --git a/qcsrc/common/mutators/base.qh b/qcsrc/common/mutators/base.qh index b9a69caf9..c1d658576 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; \ } \ } \