• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

超漢字上で、mrubyを使ってhello worldを表示させる。


Commit MetaInfo

Revision20f69555e2fe5dbad78dc10af80a7503b617278a (tree)
Time2017-06-05 23:18:29
Authorornse01 <ornse01@user...>
Commiterornse01

Log Message

fix for B-right/V environment.

Change Summary

Incremental Difference

--- a/src/mrbgems_port/mruby-test/driver.c
+++ b/src/mrbgems_port/mruby-test/driver.c
@@ -6,9 +6,11 @@
66 */
77
88
9-#include <stdio.h>
10-#include <stdlib.h>
11-#include <string.h>
9+#include <basic.h>
10+#include <bstdio.h>
11+#include <bstdlib.h>
12+#include <bstring.h>
13+#include <btron/btron.h>
1214
1315 #include "mruby.h"
1416 #include "mruby/proc.h"
@@ -18,6 +20,8 @@
1820 #include "mruby/variable.h"
1921 #include "mruby/array.h"
2022
23+#include "../../posix_include/stdlib.h"
24+
2125 void
2226 mrb_init_mrbtest(mrb_state *);
2327
@@ -60,12 +64,10 @@ static void
6064 t_printstr(mrb_state *mrb, mrb_value obj)
6165 {
6266 char *s;
63- int len;
6467
6568 if (mrb_string_p(obj)) {
6669 s = RSTRING_PTR(obj);
67- len = RSTRING_LEN(obj);
68- fwrite(s, len, 1, stdout);
70+ printf("%s", s);
6971 }
7072 }
7173
@@ -136,8 +138,8 @@ mrb_t_pass_result(mrb_state *mrb_dst, mrb_state *mrb_src)
136138 }
137139 }
138140
139-int
140-main(int argc, char **argv)
141+EXPORT W
142+MAIN(MESSAGE *msg)
141143 {
142144 mrb_state *mrb;
143145 int ret;
@@ -148,14 +150,16 @@ main(int argc, char **argv)
148150 /* new interpreter instance */
149151 mrb = mrb_open();
150152 if (mrb == NULL) {
151- fprintf(stderr, "Invalid mrb_state, exiting test driver");
153+ printf("Invalid mrb_state, exiting test driver");
152154 return EXIT_FAILURE;
153155 }
154156
157+ /*
155158 if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'v') {
156159 printf("verbose mode: enable\n\n");
157160 verbose = TRUE;
158161 }
162+ */
159163
160164 mrb_init_test_driver(mrb, verbose);
161165 mrb_init_mrbtest(mrb);
--- a/src/mrbgems_port/mruby-test/init_mrbtest.c
+++ b/src/mrbgems_port/mruby-test/init_mrbtest.c
@@ -19,7 +19,7 @@ mrb_init_mrbtest(mrb_state *mrb)
1919
2020 core_test = mrb_open_core(mrb_default_allocf, NULL);
2121 if (core_test == NULL) {
22- fprintf(stderr, "Invalid mrb_state, exiting %s", __FUNCTION__);
22+ printf("Invalid mrb_state, exiting %s", __FUNCTION__);
2323 exit(EXIT_FAILURE);
2424 }
2525 mrb_init_test_driver(core_test, mrb_test(mrb_gv_get(mrb, mrb_intern_lit(mrb, "$mrbtest_verbose"))));
--- a/src/mrbgems_port/mruby-test/mrbgem.rake
+++ b/src/mrbgems_port/mruby-test/mrbgem.rake
@@ -1,6 +1,6 @@
11 MRuby::Gem::Specification.new('mruby-test') do |spec|
22 spec.license = 'MIT'
3- spec.author = 'mruby developers'
3+ spec.author = ['mruby developers', 'ornse01']
44 spec.summary = 'mruby test'
55
66 build.bins << 'mrbtest'
@@ -81,7 +81,7 @@ MRuby::Gem::Specification.new('mruby-test') do |spec|
8181 f.puts %Q[ ai = mrb_gc_arena_save(mrb);]
8282 f.puts %Q[ mrb2 = mrb_open_core(mrb_default_allocf, NULL);]
8383 f.puts %Q[ if (mrb2 == NULL) {]
84- f.puts %Q[ fprintf(stderr, "Invalid mrb_state, exiting \%s", __FUNCTION__);]
84+ f.puts %Q[ printf("Invalid mrb_state, exiting \%s", __FUNCTION__);]
8585 f.puts %Q[ exit(EXIT_FAILURE);]
8686 f.puts %Q[ }]
8787 dep_list.each do |d|