|I am sorry you went thru all this , but the issue is not in compiling.
The code just need those "redefinitions" to work, it compiles fine.
I ll go thru your code to see if there is some other change I could use. .
My Ellipse is on strike again - the code is not passing updated executable to the remote system. I have to fix that to see if any modifications make it work.
The "gcc" has an option to -include file and if I put the #define DEBUG in header file and use this compiler -include option it should work.