-#define MUTATOR_HOOK(cb, func, order) MACRO_BEGIN { \
- MUTATOR_ONADD { \
- if (!CallbackChain_Add(HOOK_##cb, CALLBACK_##func, order)) { \
- LOG_INFO("HOOK FAILED: ", #cb, ":", #func); \
- return true; \
- } \
- } \
- MUTATOR_ONROLLBACK_OR_REMOVE { \
- CallbackChain_Remove(HOOK_##cb, CALLBACK_##func); \
- } \
-} MACRO_END
+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)) { \
+ _mutPrintFail(#cb, #func); \
+ return true; \
+ } \
+ } \
+ MUTATOR_ONROLLBACK_OR_REMOVE { \
+ CallbackChain_Remove(HOOK_##cb, CB_##func); \
+ } \
+MACRO_END