[fdo-dev] Where to put improvements?

Mateusz Loskot mateusz at loskot.net
Sat Dec 16 13:19:50 EST 2006


Hi,

Here is another tech-note to discuss.
In the file

fdocore\Utilities\Common\Inc\stdafx.h

There is following piece of code:

#ifdef _DEBUG
    #ifdef _WIN32
#ifndef ASSERT
        #include <crtdbg.h>
        #define ASSERT  _ASSERT
#endif
    #else
    /// linux doesn't seem to have a standard assert mechanism?
        #define _ASSERT(x)
        #define ASSERT(x)
    #endif
#else



C++ compiler and C++ library on Linux does provide standard
diagnostics mechanism in form of assertions.
The standard assert mechanism in C++ is assert() macro
from the <cassert> header.
ASSERT, _ASSERT and _ASSERTE are Microsoft specific
extensions, as well as ATLASSERT and derivatives.

I believe it's not a good idea to disable assertions on Linux
with empty macros.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net




More information about the Fdo_dev mailing list