You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Peter A. Volchek" <Pe...@ti.com.od.ua> on 2001/06/19 14:14:14 UTC

null

Here the piece of code from dom/NodeImpl.hpp

//  define 'null' is used extensively in the DOM implementation code,
//  as a consequence of its Java origins.
//  MSVC 5.0 compiler has problems with overloaded function resolution
// when using the const int definition.
//
#if defined(XML_CSET)
const int null = 0;
#else
#define null 0
#endif

Here, the declaration of one of my exisiting classes

class MyId
{
public:

    // returns the null identifier (one in the system)
    static const MyId& null();
    ...
};

When compiling (MSVC5) I get the following compile errors

error C2059: syntax error : 'constant'
error C2238: unexpected token(s) preceding ';'

I need to 
#undefine null
to get rid of this.

Why not you use NULL instead?


Peter A. Volchek
Software Engineer
Metis International, Inc.
PeterV@ti.com.od.ua



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org