xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Nutt <msn...@forwiss.de>
Subject NO_NATIVE_BOOL
Date Mon, 05 Feb 2001 15:04:15 GMT
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


Mime
View raw message