Skip to content

Commit d893125

Browse files
committed
internal.h: unify our own stdtbool.h implementation
because we had another one in missing/stdbool.h as well. Assuming that _Bool does not exist when stdbool.h is absent, I'm in favor of r57462 implementation rather than r61326. Note that Visual Studio 2013 has stdbool.h and thus r57462's commit message is somewhat misleading. This missing/stdbool.h is for Visual Studio 2012 or older, and for Oracle Solaris Studio 12.2 or older because it's added in 12.3 https://docs.oracle.com/cd/E24457_01/html/E21987/gkeza.html. missing/stdbool.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent d9699fa commit d893125

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

internal.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,8 @@ extern "C" {
2323

2424
#ifdef HAVE_STDBOOL_H
2525
# include <stdbool.h>
26-
#endif
27-
28-
#ifndef __bool_true_false_are_defined
29-
# ifndef __cplusplus
30-
# undef bool
31-
# undef false
32-
# undef true
33-
# define bool signed char
34-
# define false 0
35-
# define true 1
36-
# define __bool_true_false_are_defined 1
37-
# endif
26+
#else
27+
# include "missing/stdbool.h"
3828
#endif
3929

4030
/* The most significant bit of the lower part of half-long integer.

missing/stdbool.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
#ifndef _MISSING_STDBOOL_H_
66
#define _MISSING_STDBOOL_H_
77

8-
#ifndef __cplusplus
9-
10-
#define bool _Bool
11-
#define true 1
12-
#define false 0
13-
14-
#ifndef HAVE__BOOL /* AC_HEADER_STDBOOL in configure.ac */
15-
typedef int _Bool;
16-
#endif /* HAVE__BOOL */
17-
18-
#endif /* __cplusplus */
8+
#ifndef __bool_true_false_are_defined
9+
# ifndef __cplusplus
10+
# undef bool
11+
# undef false
12+
# undef true
13+
# define bool signed char
14+
# define false 0
15+
# define true 1
16+
# define __bool_true_false_are_defined 1
17+
# endif
18+
#endif
1919

2020
#endif /* _MISSING_STDBOOL_H_ */

0 commit comments

Comments
 (0)