----- Original Message -----
From: "Steve Lee" <steve@...>
Sent: Wednesday, October 27, 2004 2:48 PM
Subject: Re: [Mingw-users] crtdbg.h and _ASSERT
> Aaron W. LaFramboise wrote:
> > Steve Lee wrote:
> >>The code that I am porting defines its own assert in terms of _ASSERT.
> >>I can't find either crtdbg.h or _ASSERT in MinGW so is something defined
> >>that I can use? Preferably with out changing the code.
> > The usual macro we use for this is NDEBUG, which is what controls the
> > standard assert(). See ISO 9899:1999 7.2 for helpful details on how
> > assert() is implemented. If you don't have a copy, and dont have $18 to
> > buy the PDF, similar drafts are availible online for free by websearch.
> > Aaron W. LaFramboise
> But I'm missing the definetion of the _ASSERT macro which I believe is
> microsoft runtime specific.
> crtdbg = c runtime debug. MinGW does a brilliant job of replacing much
> of the much of the runtime functionality.
> I realise I can always reproduce the behavior and avoid using the MS
> specific _ASSERT. Is it provided and I have just missed it?
> I'm trying to port with minimum code changes.
> Which CRT features are supported?
I think that proving _ASSERT for MinGW is not simply a matter of writing the
header file (which you are free to contribute if you wish) because the
assertion failure handler _CrtDbgReport() is only present in msvcrtd.dll,
not the msvcrt.dll that MinGW uses. Although MinGW already has an import
library for msvcrtd.dll, AFAIK you can only use it if you modify the GCC
"specs" file because it currently always links with msvcrt.dll.