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 Matthias Nutt <ms...@forwiss.de> on 2001/02/05 16:04:15 UTC

NO_NATIVE_BOOL

hi folks,

I had the following problem using Xerces-C (Version 1.2.0).
Compiling my code on Linux works straight forward, but on 
Sun (SunOS 5.7, CC 4.2) it fails. Here is the reason why:

Compiling Xerces was not problem, but to get the code
working together with the LEDA library is. Compiling
fails because in LEDA "bool" is typedefed to "char" and
in Xerces "bool" is typedefed to "int".

So I edited util/XercesDefs.hpp:

// ---------------------------------------------------------------------------
//  Handle boolean. If the platform can handle booleans itself, then we
//  map our boolean type to the native type. Otherwise we create a default
//  one as an int and define const values for true and false.
//
//  This flag will be set in the per-development environment stuff above.
// ---------------------------------------------------------------------------
#if defined(NO_NATIVE_BOOL)
  #ifndef bool
    #ifdef __sun
        // This is a dirty hack by Matthias Nutt
        // On our system using LEDA bool is already typedefed as char
        // Matthias Nutt, Feb. 2001
        typedef char bool;
    #else
        typedef int     bool;
    #endif
  #endif
  #ifndef true
    #define  true     1
  #endif
  #ifndef false
    #define false 0
  #endif
#endif

Currently I dont know a solution for this. Maybe some of you has
a good hint for this problem. 

Bye Matthias