summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2013-03-14 04:51:14 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2013-03-14 04:51:14 -0700
commitce1756b3b6a23050d96d49aef64a7f964e8bc75f (patch)
treed6a5e4741a5bd045d2eb3c3c4cb194310454e892 /include
parent38571fd76994806ee33b1fa2400d1de92de7bdb7 (diff)
parent1ffc9ba3255f8b63164c42ea8304115f5a6b2464 (diff)
downloadmruby-ce1756b3b6a23050d96d49aef64a7f964e8bc75f.tar.gz
mruby-ce1756b3b6a23050d96d49aef64a7f964e8bc75f.zip
Merge pull request #997 from monaka/pr-add-type-mrb_bool_t
Define mrb_bool_t.
Diffstat (limited to 'include')
-rw-r--r--include/mrbconf.h2
-rw-r--r--include/mruby.h6
-rw-r--r--include/mruby/compile.h14
3 files changed, 12 insertions, 10 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index cabc10b4f..275cdf4c1 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -110,8 +110,10 @@ typedef short mrb_sym;
# define strtoll _strtoi64
# define PRId32 "I32d"
# define PRId64 "I64d"
+typedef unsigned int mrb_bool;
#else
# include <inttypes.h>
+typedef _Bool mrb_bool;
#endif
#ifdef ENABLE_STDIO
diff --git a/include/mruby.h b/include/mruby.h
index 018a6a678..1054fd639 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -121,9 +121,9 @@ typedef struct mrb_state {
size_t gc_threshold;
int gc_interval_ratio;
int gc_step_ratio;
- unsigned int gc_disabled:1;
- unsigned int gc_full:1;
- unsigned int is_generational_gc_mode:1;
+ mrb_bool gc_disabled:1;
+ mrb_bool gc_full:1;
+ mrb_bool is_generational_gc_mode:1;
size_t majorgc_old_threshold;
struct alloca_header *mems;
diff --git a/include/mruby/compile.h b/include/mruby/compile.h
index 2cbc28321..a50c85e42 100644
--- a/include/mruby/compile.h
+++ b/include/mruby/compile.h
@@ -21,9 +21,9 @@ typedef struct mrbc_context {
int slen;
char *filename;
short lineno;
- int capture_errors:1;
- int dump_result:1;
- int no_exec:1;
+ mrb_bool capture_errors:1;
+ mrb_bool dump_result:1;
+ mrb_bool no_exec:1;
} mrbc_context;
mrbc_context* mrbc_context_new(mrb_state *mrb);
@@ -67,8 +67,8 @@ enum heredoc_type {
/* heredoc structure */
struct mrb_parser_heredoc_info {
enum heredoc_type type;
- int allow_indent:1;
- int line_head:1;
+ mrb_bool allow_indent:1;
+ mrb_bool line_head:1;
const char *term;
int term_len;
mrb_ast_node *doc;
@@ -102,8 +102,8 @@ struct mrb_parser_state {
mrb_ast_node *heredocs; /* list of mrb_parser_heredoc_info* */
mrb_ast_node *parsing_heredoc;
- int heredoc_starts_nextline:1;
- int heredoc_end_now:1; /* for mirb */
+ mrb_bool heredoc_starts_nextline:1;
+ mrb_bool heredoc_end_now:1; /* for mirb */
void *ylval;