using VC++ 6.0 I have a piece of code that I want compiled only when I build the debug version and a diffeerent section of code I want compiled only when I build the release version. anyone know what the preprocessor directives are for doing this?
using VC++ 6.0 I have a piece of code that I want compiled only when I build the debug version and a diffeerent section of code I want compiled only when I build the release version. anyone know what the preprocessor directives are for doing this?
The pre-processor symbol NDEBUG is defined when you do a release build.
Seems dangerous to me. Debug code should only contain "extra" code - to help you debug it, not different code between debug and release.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Thanks, what Im doing is skipping the anti-debugger check in the debug code, since I want to be able to use a debugger during development, and including it in the release, since I dont want people reverse engineering my software. While Im sure its still possible to RE even with this check i just want to make it as difficult as possible.
Last edited by abachler; 08-08-2007 at 10:41 AM.
It might slow down someone who is good by all of about 5 seconds.
Just long enough for them to knobble the "isDebuggerPresent" into always returning false.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.