Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/unistring/stdbool.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
0002 #if !defined _GL_STDBOOL_H
0003 #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
0004 #include <stdbool.h>
0005 #else
0006 /* Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
0007    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
0008 
0009    This program is free software; you can redistribute it and/or modify
0010    it under the terms of the GNU Lesser General Public License as published by
0011    the Free Software Foundation; either version 2, or (at your option)
0012    any later version.
0013 
0014    This program is distributed in the hope that it will be useful,
0015    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017    GNU Lesser General Public License for more details.
0018 
0019    You should have received a copy of the GNU Lesser General Public License
0020    along with this program; if not, see <https://www.gnu.org/licenses/>.  */
0021 
0022 #ifndef _UNISTRING_STDBOOL_H
0023 #define _UNISTRING_STDBOOL_H
0024 
0025 /* ISO C 99 <stdbool.h> for platforms that lack it.  */
0026 
0027 /* Usage suggestions:
0028 
0029    Programs that use <stdbool.h> should be aware of some limitations
0030    and standards compliance issues.
0031 
0032    Standards compliance:
0033 
0034        - <stdbool.h> must be #included before 'bool', 'false', 'true'
0035          can be used.
0036 
0037        - You cannot assume that sizeof (bool) == 1.
0038 
0039        - Programs should not undefine the macros bool, true, and false,
0040          as C99 lists that as an "obsolescent feature".
0041 
0042    Limitations of this substitute, when used in a C89 environment:
0043 
0044        - <stdbool.h> must be #included before the '_Bool' type can be used.
0045 
0046        - You cannot assume that _Bool is a typedef; it might be a macro.
0047 
0048        - Bit-fields of type 'bool' are not supported.  Portable code
0049          should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
0050 
0051        - In C99, casts and automatic conversions to '_Bool' or 'bool' are
0052          performed in such a way that every nonzero value gets converted
0053          to 'true', and zero gets converted to 'false'.  This doesn't work
0054          with this substitute.  With this substitute, only the values 0 and 1
0055          give the expected result when converted to _Bool' or 'bool'.
0056 
0057        - C99 allows the use of (_Bool)0.0 in constant expressions, but
0058          this substitute cannot always provide this property.
0059 
0060    Also, it is suggested that programs use 'bool' rather than '_Bool';
0061    this isn't required, but 'bool' is more common.  */
0062 
0063 
0064 /* 7.16. Boolean type and values */
0065 
0066 #ifdef __cplusplus
0067   /* Assume the compiler has 'bool' and '_Bool'.  */
0068 #else
0069   /* <stdbool.h> is known to exist and work with the following compilers:
0070        - GNU C 3.0 or newer, on any platform,
0071        - Intel C,
0072        - MSVC 12 (Visual Studio 2013) or newer,
0073        - Sun C, on Solaris, if _STDC_C99 is defined,
0074        - AIX xlc, if _ANSI_C_SOURCE is defined,
0075        - HP C, on HP-UX 11.31 or newer.
0076      It is know not to work with:
0077        - Sun C, on Solaris, if __C99FEATURES__ is defined but _STDC_C99 is not,
0078        - MIPSpro C 7.30, on IRIX.  */
0079 # if (__GNUC__ >= 3) \
0080      || defined __INTEL_COMPILER \
0081      || (_MSC_VER >= 1800) \
0082      || (defined __SUNPRO_C && defined _STDC_C99) \
0083      || (defined _AIX && !defined __GNUC__ && defined _ANSI_C_SOURCE) \
0084      || defined __HP_cc
0085    /* Assume the compiler has <stdbool.h>.  */
0086 #  include <stdbool.h>
0087 # else
0088    /* Need to define _Bool ourselves. As 'signed char' or as an enum type?
0089       Use of a typedef, with SunPRO C, leads to a stupid
0090         "warning: _Bool is a keyword in ISO C99".
0091       Use of an enum type, with IRIX cc, leads to a stupid
0092         "warning(1185): enumerated type mixed with another type".
0093       Even the existence of an enum type, without a typedef,
0094         "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
0095       The only benefit of the enum, debuggability, is not important
0096       with these compilers.  So use 'signed char' and no enum.  */
0097 #  define _Bool signed char
0098 #  define bool _Bool
0099 # endif
0100 #endif
0101 
0102 /* The other macros must be usable in preprocessor directives.  */
0103 #ifdef __cplusplus
0104 # if !defined _MSC_VER
0105 #  define false false
0106 #  define true true
0107 # endif
0108 /* In Sun C++ 5.11 (Solaris Studio 12.2) and older, 'true' as a preprocessor
0109    expression evaluates to 0, not 1.  Fix this by overriding 'true'.  Note that
0110    the replacement has to be of type 'bool'.  */
0111 # if defined __SUNPRO_CC && true != 1
0112 #  undef true
0113 #  define true (!false)
0114 # endif
0115 #else
0116 # undef false
0117 # define false 0
0118 # undef true
0119 # define true 1
0120 #endif
0121 
0122 #define __bool_true_false_are_defined 1
0123 
0124 #endif /* _UNISTRING_STDBOOL_H */
0125 #endif
0126 #endif