summaryrefslogtreecommitdiffstats
path: root/gl/stdbool.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/stdbool.in.h')
-rw-r--r--gl/stdbool.in.h27
1 files changed, 5 insertions, 22 deletions
diff --git a/gl/stdbool.in.h b/gl/stdbool.in.h
index 2a1992d..2fa4672 100644
--- a/gl/stdbool.in.h
+++ b/gl/stdbool.in.h
@@ -1,4 +1,4 @@
1/* Copyright (C) 2001-2003, 2006-2021 Free Software Foundation, Inc. 1/* Copyright (C) 2001-2003, 2006-2022 Free Software Foundation, Inc.
2 Written by Bruno Haible <haible@clisp.cons.org>, 2001. 2 Written by Bruno Haible <haible@clisp.cons.org>, 2001.
3 3
4 This file is free software: you can redistribute it and/or modify 4 This file is free software: you can redistribute it and/or modify
@@ -58,27 +58,11 @@
58 58
59/* 7.16. Boolean type and values */ 59/* 7.16. Boolean type and values */
60 60
61/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same
62 definitions below, but temporarily we have to #undef them. */
63#if defined __BEOS__ && !defined __HAIKU__
64# include <OS.h> /* defines bool but not _Bool */
65# undef false
66# undef true
67#endif
68
69#ifdef __cplusplus 61#ifdef __cplusplus
70# define _Bool bool 62# define _Bool bool
71# define bool bool 63# define bool bool
72#else 64#else
73# if defined __BEOS__ && !defined __HAIKU__ 65# if !defined __GNUC__
74 /* A compiler known to have 'bool'. */
75 /* If the compiler already has both 'bool' and '_Bool', we can assume they
76 are the same types. */
77# if !@HAVE__BOOL@
78typedef bool _Bool;
79# endif
80# else
81# if !defined __GNUC__
82 /* If @HAVE__BOOL@: 66 /* If @HAVE__BOOL@:
83 Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when 67 Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
84 the built-in _Bool type is used. See 68 the built-in _Bool type is used. See
@@ -98,10 +82,10 @@ typedef bool _Bool;
98 "Invalid enumerator. (badenum)" with HP-UX cc on Tru64. 82 "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
99 The only benefit of the enum, debuggability, is not important 83 The only benefit of the enum, debuggability, is not important
100 with these compilers. So use 'signed char' and no enum. */ 84 with these compilers. So use 'signed char' and no enum. */
101# define _Bool signed char 85# define _Bool signed char
102# else 86# else
103 /* With this compiler, trust the _Bool type if the compiler has it. */ 87 /* With this compiler, trust the _Bool type if the compiler has it. */
104# if !@HAVE__BOOL@ 88# if !@HAVE__BOOL@
105 /* For the sake of symbolic names in gdb, define true and false as 89 /* For the sake of symbolic names in gdb, define true and false as
106 enum constants, not only as macros. 90 enum constants, not only as macros.
107 It is tempting to write 91 It is tempting to write
@@ -112,7 +96,6 @@ typedef bool _Bool;
112 (see ISO C 99 6.3.1.1.(2)). So add a negative value to the 96 (see ISO C 99 6.3.1.1.(2)). So add a negative value to the
113 enum; this ensures that '_Bool' promotes to 'int'. */ 97 enum; this ensures that '_Bool' promotes to 'int'. */
114typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; 98typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
115# endif
116# endif 99# endif
117# endif 100# endif
118# define bool _Bool 101# define bool _Bool