How to cause a release build to minimize 'debug' code?

  • Thread starter Thread starter Egbert Nierop \(MVP for IIS\)
  • Start date Start date
E

Egbert Nierop \(MVP for IIS\)

Hi,

I have had AtlTrace statements, but for file logging and debugging purposes,
I wrote something similar.

But when I release the code, the compiler does not 'ignore' the statements
just as it does with TRACE or ATLTRACE etc statements.

Is there a trick to get this behaviour?

Thanks!
 
Egbert Nierop (MVP for IIS) said:
Hi,

I have had AtlTrace statements, but for file logging and debugging
purposes, I wrote something similar.

But when I release the code, the compiler does not 'ignore' the statements
just as it does with TRACE or ATLTRACE etc statements.

Is there a trick to get this behaviour?

The wonder of C/C++ macros. TRACE (et al) are simply macros that expand to
a logging call in a debug build (#ifndef NDEBUG) and to nothing in a release
build (#ifdef NDEBUG)

-cd
 
Back
Top