We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d9c6fdc + df35321 commit dbc2d64Copy full SHA for dbc2d64
ext/json/ext/generator/generator.h
@@ -6,12 +6,21 @@
6
7
#include "ruby.h"
8
9
-#ifdef HAVE_STDBOOL_H
10
-#include <stdbool.h>
11
-#else
12
-/* This is the fallback definition from Ruby 3.0.5. */
13
-typedef unsigned char _Bool
14
-#define bool _Bool
+/* This is the fallback definition from Ruby 3.4 */
+#ifndef RBIMPL_STDBOOL_H
+#if defined(__cplusplus)
+# if defined(HAVE_STDBOOL_H) && (__cplusplus >= 201103L)
+# include <cstdbool>
+# endif
15
+#elif defined(HAVE_STDBOOL_H)
16
+# include <stdbool.h>
17
+#elif !defined(HAVE__BOOL)
18
+typedef unsigned char _Bool;
19
+# define bool _Bool
20
+# define true ((_Bool)+1)
21
+# define false ((_Bool)+0)
22
+# define __bool_true_false_are_defined
23
+#endif
24
#endif
25
26
#ifdef HAVE_RUBY_RE_H
0 commit comments