Last change
on this file since 398 was 331, checked in by coas-nagasima, 6 years ago |
prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc;charset=UTF-8
|
File size:
536 bytes
|
Line | |
---|
1 | #include <limits.h>
|
---|
2 | #include <mruby.h>
|
---|
3 |
|
---|
4 | static mrb_value
|
---|
5 | mrb_int_chr(mrb_state *mrb, mrb_value x)
|
---|
6 | {
|
---|
7 | mrb_int chr;
|
---|
8 | char c;
|
---|
9 |
|
---|
10 | chr = mrb_fixnum(x);
|
---|
11 | if (chr >= (1 << CHAR_BIT)) {
|
---|
12 | mrb_raisef(mrb, E_RANGE_ERROR, "%S out of char range", x);
|
---|
13 | }
|
---|
14 | c = (char)chr;
|
---|
15 |
|
---|
16 | return mrb_str_new(mrb, &c, 1);
|
---|
17 | }
|
---|
18 |
|
---|
19 | void
|
---|
20 | mrb_mruby_numeric_ext_gem_init(mrb_state* mrb)
|
---|
21 | {
|
---|
22 | struct RClass *i = mrb_class_get(mrb, "Integer");
|
---|
23 |
|
---|
24 | mrb_define_method(mrb, i, "chr", mrb_int_chr, MRB_ARGS_NONE());
|
---|
25 | }
|
---|
26 |
|
---|
27 | void
|
---|
28 | mrb_mruby_numeric_ext_gem_final(mrb_state* mrb)
|
---|
29 | {
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.