mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Add global constant MRUBY_COPYRIGHT
This commit is contained in:
+7
-1
@@ -73,6 +73,12 @@ mrb_show_copyright(mrb_state *mrb)
|
||||
static const char copyright_msg[] = "mruby - Copyright (c) 2010-2014 mruby developers\n";
|
||||
mrb_value msg;
|
||||
|
||||
msg = mrb_str_new(mrb, copyright_msg, sizeof(copyright_msg) - 1);
|
||||
if (mrb_const_defined(mrb, mrb_obj_value(mrb->object_class), mrb_intern_lit(mrb, "MRUBY_COPYRIGHT"))) {
|
||||
msg = mrb_const_get(mrb, mrb_obj_value(mrb->object_class), mrb_intern_lit(mrb, "MRUBY_COPYRIGHT"));
|
||||
msg = mrb_funcall(mrb, msg, "+", 1, mrb_str_new_cstr(mrb, "\n"));
|
||||
}
|
||||
else {
|
||||
msg = mrb_str_new(mrb, copyright_msg, sizeof(copyright_msg) - 1);
|
||||
}
|
||||
printstr(mrb, msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user