debug_printf_noop() was incorrectly defined as a function, which still has a runtime cost of argument evaluation.

This commit is contained in:
Stephen Atherton 2019-05-22 03:40:18 -07:00
parent f99c36aad2
commit 0fb8612ef5
1 changed files with 1 additions and 2 deletions

View File

@ -31,8 +31,7 @@
#define debug_printf_always(...) { fprintf(stdout, "%s %f ", g_network->getLocalAddress().toString().c_str(), now()), fprintf(stdout, __VA_ARGS__); fflush(stdout); } #define debug_printf_always(...) { fprintf(stdout, "%s %f ", g_network->getLocalAddress().toString().c_str(), now()), fprintf(stdout, __VA_ARGS__); fflush(stdout); }
template <class... T> #define debug_printf_noop(...)
void debug_printf_noop(T&&...) {}
#if REDWOOD_DEBUG #if REDWOOD_DEBUG
#define debug_printf debug_printf_always #define debug_printf debug_printf_always