|
From: Andreas G. <ag...@on...> - 2003-08-25 13:24:49
|
On Montag, August 25, 2003, at 02:30 Uhr, Miro Jurisic wrote:
>> Summarize:
>
> Excellent summary.
>
>> The macro DEBUG, is used also in Debugging.h (in Mac OS system
>> headers) which will be often included in precompiled headers.
>
> The same holds of NDEBUG and _DEBUG. The way they are currently
> handled is that Whisper makes sure that NDEBUG and _DEBUG are
> synchronized with DEBUG, and then consistently uses DEBUG itself.
>
> I think that's a good way to handle the Mac OS DEBUG macro as well --
> replace it with WHISPER_DEBUG and make sure that DEBUG, NDEBUG, and
> _DEBUG are all synchronized with it (see XDebug.h).
That is (somewhere during configuration, after primary conditionals
have been set):
// Set defaults for debugging macros DEBUG, _DEBUG, NDEBUG:
#if WHISPER_BUILD_DEBUG
#ifdef WHISPER_PLATFORM_MAC
// Optionally enable Carbon debug macros (see Debugging.h):
// Comment out this macro if you don't need Carbon debug macros.
#define DEBUG 1 /*We need set it to 1 (one), if defined!*/
#endif
#ifdef WHISPER_PLATFORM_WIN
#define _DEBUG /* (windows expert shall verify!!)*/
#endif
#else
// Non debug build:
// do not expand assertion macros in std lib
#define NDEBUG
#endif // WHISPER_BUILD_DEBUG
Note: we should rarely use platform dependent macros in Whisper
sources! When the source is already platform specific, well, then its
OK.
>
>> Draw back: macros may have lengthy names.
>
> I can live with that, but I would prefer if we did not add a category
> to those macros which we anticipate will be used often --
> WHISPER_ASSERT et al. It's enough that we are lengthening them with
> WHISPER_, we don't need to add a category as well.
Agree. Don't want write WHISPER_DEBUG_DEBUGSTR etc., too ;)
Andreas
>
> meeroh
> --
>
> <http://web.meeroh.org/> | KB1FMP
>
> A: Because it reverses the logical flow of conversation.
> Q: Why is top posting frowned upon?
>
|