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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top