summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mruby/value.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/mruby/value.h b/include/mruby/value.h
index eae08855d..88fbf098c 100644
--- a/include/mruby/value.h
+++ b/include/mruby/value.h
@@ -274,4 +274,20 @@ mrb_undef_value(void)
return v;
}
+static inline mrb_value
+mrb_true_or_false_value(mrb_bool boolean)
+{
+ mrb_value v;
+
+ v.value.i = 1;
+ if (boolean) {
+ v.tt = MRB_TT_TRUE;
+ }
+ else {
+ v.tt = MRB_TT_FALSE;
+ }
+
+ return v;
+}
+
#endif /* MRUBY_OBJECT_H */