always use unsigned int as mrb_bool even in C++

parent 22469f3b
...@@ -132,18 +132,8 @@ typedef short mrb_sym; ...@@ -132,18 +132,8 @@ typedef short mrb_sym;
# define PRIo64 "I64o" # define PRIo64 "I64o"
# define PRIx64 "I64x" # define PRIx64 "I64x"
# define PRIX64 "I64X" # define PRIX64 "I64X"
# ifdef __cplusplus
typedef bool mrb_bool;
# else
typedef unsigned int mrb_bool;
# endif
#else #else
# include <inttypes.h> # include <inttypes.h>
# ifdef __cplusplus
typedef bool mrb_bool;
# else
typedef _Bool mrb_bool;
# endif
#endif #endif
#ifdef ENABLE_STDIO #ifdef ENABLE_STDIO
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#ifndef MRUBY_VALUE_H #ifndef MRUBY_VALUE_H
#define MRUBY_VALUE_H #define MRUBY_VALUE_H
typedef unsigned int mrb_bool;
#ifndef MRB_NAN_BOXING #ifndef MRB_NAN_BOXING
enum mrb_vtype { enum mrb_vtype {
......
...@@ -1286,7 +1286,7 @@ mrb_str_include(mrb_state *mrb, mrb_value self) ...@@ -1286,7 +1286,7 @@ mrb_str_include(mrb_state *mrb, mrb_value self)
mrb_get_args(mrb, "o", &str2); mrb_get_args(mrb, "o", &str2);
if (mrb_type(str2) == MRB_TT_FIXNUM) { if (mrb_type(str2) == MRB_TT_FIXNUM) {
include_p = memchr(RSTRING_PTR(self), mrb_fixnum(str2), RSTRING_LEN(self)); include_p = (memchr(RSTRING_PTR(self), mrb_fixnum(str2), RSTRING_LEN(self)) != NULL);
} }
else { else {
str2 = mrb_str_to_str(mrb, str2); str2 = mrb_str_to_str(mrb, str2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment