Commit 4f9503ac authored by Masaki Muranaka's avatar Masaki Muranaka

Add new API mrb_true_or_false_value().

parent 6611c18c
......@@ -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 */
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