Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-12-10 16:16:47


At 03:40 PM 12/10/2002, David Abrahams wrote:

>"Rozental, Gennadiy" <gennadiy.rozental_at_[hidden]> writes:
>
>>> "Gennadiy Rozental" <gennadiy.rozental_at_[hidden]> writes:
>>>
>>> >> metrowerks-C++-action
>>> >
>>> c:\build\libs\test\build\bin\libboost_unit_test_framework.lib\
>> cwpro8.3\debug
>>> > \runtime-link-dynamic\execution_monitor.obj
>>> >> ### mwcc Compiler:
>>> >> # File: ..\libs\test\src\execution_monitor.cpp
>>> >> # -----------------------------------------------
>>> >> # 157: case _CRT_ASSERT:
>>> >> # Error: ^^^^^^^^^^^
>>> >> # undefined identifier '_CRT_ASSERT'
>>> >> ### mwcc Compiler:
>>> >> # 161: case _CRT_ERROR:
>>> >> # Error: ^^^^^^^^^^
>>> >> # undefined identifier '_CRT_ERROR'
>>> >
>>> > This one appears to be caused by the fact that metrowerks
>>> tools does not
>>> > define the symbol _DEBUG in debug mode
>>>
>>> Why don't you fix that one, too?
>>> _DEBUG is an MSVC-specific symbol.
>>
>> MSVC toolset defines it.
>
>I see no evidence to support that claim.
>
>The msvc compiler flags which turn on debug symbols, etc., also cause
>_DEBUG to be defined. The toolset never touches "_DEBUG".
>
>> While metrowerks don't. Do you want me to fix the latter?
>
>I don't think I want you to "fix" it. As a user, you're not allowed
>to #define _DEBUG, since that symbol is reserved to the
>implementation.

Dave is right, of course.

The correct fix is to not use a Microsoft debugging feature for a compiler
that doesn't support it.

I've committed the following fix:

+#if !defined(__MWERKS__)
#define BOOST_MS_CRT_DEBUG_HOOK
#include <crtdbg.h>
+#endif

That clears the problem. Usually I'd rather the developer make the fix, but
this one was holding up both Boost and non-Boost work.

--Beman


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk