• 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

Révision474efb35918d3b026f91b30baaf5c747c6e7a0fc (tree)
l'heure2017-06-05 23:18:29
Auteurornse01 <ornse01@user...>
Commiterornse01

Message de Log

change build rule. posix wrapper to mrbgems

Change Summary

Modification

--- a/src/build_config.rb
+++ b/src/build_config.rb
@@ -106,6 +106,7 @@ MRuby::CrossBuild.new('pcat') do |conf|
106106
107107 @bins = [] # for disable to link mrbc for target.
108108
109+ conf.gem 'mrbgems_port/mruby-brightv-posixwrapper'
109110 conf.gem 'mrbgems_port/mruby-brightv-print'
110111 conf.gem 'mruby/mrbgems/mruby-compiler'
111112 #
--- a/src/posix.c
+++ /dev/null
@@ -1,73 +0,0 @@
1-#include "posix_include/stdio.h"
2-#include "posix_include/math.h"
3-#include <bstring.h>
4-#include <bstdarg.h>
5-#include <bstdlib.h>
6-
7-double __nan()
8-{
9- static char nan_byte[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff};
10- return *(double*)nan_byte;
11-}
12-
13-int isnan(double x)
14-{
15- double nan = NAN;
16- return memcmp(&x, &nan, sizeof(double)) == 0;
17-}
18-
19-int isinf(double x)
20-{
21- double inf = INFINITY;
22- double ninf = -inf;
23- return (memcmp(&x, &inf, sizeof(double)) == 0) || (memcmp(&x, &ninf, sizeof(double)) == 0);
24-}
25-
26-int isfinite(double x)
27-{
28- return !isinf(x);
29-}
30-
31-int signbit(double x)
32-{
33- return x < 0.0;
34-}
35-
36-double fmod(double x, double y)
37-{
38- return (x - y * (double)((int)(x / y)));
39-}
40-
41-int fprintf(FILE* stream, const char* format, ...)
42-{
43- int ret = 0;
44-
45- if (*stream == stderr || *stream == stdout) {
46- va_list list;
47- va_start(list, format);
48- ret = vprintf(format, list);
49- va_end(list);
50- }
51-
52- return ret;
53-}
54-
55-int snprintf(char *s, size_t len, const char* format, ...)
56-{
57- int ret = 0;
58- int len0 = (len < 509) ? 509 : len;
59- char *p;
60- va_list list;
61-
62- p = malloc(sizeof(char)*len0*3);
63-
64- va_start(list, format);
65- ret = sprintf(p, format, list);
66- va_end(list);
67-
68- memcpy(s, p, ret > len ? len : ret);
69-
70- free(p);
71-
72- return ret;
73-}