The "sys_debug.h" file depends on SYS_DEBUG_USE_CONSOLE but that is defined in "configuration.h" which is not included.
The effect is that the macros SYS_MESSAGE, SYS_DEBUG_MESSAGE, etc. will behave differently depending on what other header files are included:
Example 1:
#include "configuration.h"
#include "system/debug/sys_debug.h"
void myCode1()
{
SYS_MESSAGE("This works as expected");
}
Example 2:
#include "system/debug/sys_debug.h"
void myCode2()
{
SYS_MESSAGE("This does NOT work as expected");
}
Example 3:
#include "system/debug/sys_console.h"
#include "system/debug/sys_debug.h"
void myCode3()
{
// Very scary invisible side-effect
SYS_MESSAGE("This works as expected because configuration.h is included in sys_console.h");
}
The fix
I think all that needs to happen is for "configuration.h" to be included within "sys_debug.h".
The behaviour is then consistent, and controlled by the configuration options in all cases.
The problem
The "sys_debug.h" file depends on SYS_DEBUG_USE_CONSOLE but that is defined in "configuration.h" which is not included.
The effect is that the macros
SYS_MESSAGE
,SYS_DEBUG_MESSAGE
, etc. will behave differently depending on what other header files are included:Example 1:
Example 2:
Example 3:
The fix
I think all that needs to happen is for "configuration.h" to be included within "sys_debug.h". The behaviour is then consistent, and controlled by the configuration options in all cases.