sheepy

build system (sheepy) and package manager (spm) for C
git clone https://spartatek.se/git/sheepy.git
Log | Files | Refs | README | LICENSE

compatStdbool-pseudo.h (1401B)


      1 /* PURPOSE: This header defines standard bool data types for use
      2  *          in plain 'C' lexical analyser engines. This is done
      3  *          here, in wise prediction that some compiler distributions
      4  *          may not provide this standard header. For the standard
      5  *          reference, please review: "The Open Group Base Specifications 
      6  *          Issue 6, IEEE Std 1003.1, 2004 Edition".
      7  *
      8  * (C) 2008  Frank-Rene Schaefer */           
      9 #ifndef __QUEX_INCLUDE_GUARD__COMPATIBILITY__STDBOOL_PSEUDO_H
     10 #define __QUEX_INCLUDE_GUARD__COMPATIBILITY__STDBOOL_PSEUDO_H
     11 
     12 #if defined(__QUEX_OPTION_PLAIN_C)
     13 
     14 /* According to the C99 Standard 'bool' would have to be defined as equal to
     15  * '_Bool' which is also defined in some standard. The author of this header,
     16  * though, found it particularly hard to determine whether the compiler obeys
     17  * these standards or not. Even prominent compilers, such as gcc at the time of
     18  * this writing, did not provide __STDC_VERSION__. Thus, the 'easy' solution to
     19  * simply define it as 'int' and call this file a 'stdbool-pseudo.h'. */
     20 #ifndef bool
     21 #   define bool int
     22 #endif
     23 
     24 #ifndef true
     25 #define true  ((int)(1))
     26 #endif
     27 #ifndef false
     28 #define false ((int)(0))
     29 #endif
     30 
     31 #ifndef __bool_true_false_are_defined
     32 #define __bool_true_false_are_defined ((int)(1))
     33 #endif
     34 
     35 #endif /* __QUEX_OPTION_PLAIN_C */
     36 #endif /* __QUEX_INCLUDE_GUARD__COMPATIBILITY__STDBOOL_PSEUDO_H */