Skip to content

Commit ca1ea95

Browse files
XrXrk0kubun
authored andcommitted
Include stdbool.h without checking with autoconf
As reported in <https://bugs.ruby-lang.org/issues/21340>, older autoconf have an AC_HEADER_STDBOOL that's incompatible with C23. Autoconf 2.72 fixed the macro, but also mentions that it's obsolescent since all current compilers have this header. Since we require C99 [1] and VS 2015 [2], should be able take that suggestion and include stdbool.h without a check. This worked fine on rubyci.org. [Backport #21340] [1]: https://bugs.ruby-lang.org/issues/15347 [2]: https://bugs.ruby-lang.org/issues/19982
1 parent 616771e commit ca1ea95

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

include/ruby/internal/stdbool.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,9 @@
3131
# define __bool_true_false_are_defined
3232
# endif
3333

34-
#elif defined(HAVE_STDBOOL_H)
35-
# /* Take stdbool.h definition. */
34+
#else
35+
# /* Take stdbool.h definition. It exists since GCC 3.0 and VS 2015. */
3636
# include <stdbool.h>
37-
38-
#elif !defined(HAVE__BOOL)
39-
typedef unsigned char _Bool;
40-
# /* See also http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2229.htm */
41-
# define bool _Bool
42-
# define true ((_Bool)+1)
43-
# define false ((_Bool)+0)
44-
# define __bool_true_false_are_defined
4537
#endif
4638

4739
#endif /* RBIMPL_STDBOOL_H */

0 commit comments

Comments
 (0)