diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/mrbconf.h | 11 | ||||
| -rw-r--r-- | include/mruby/string.h | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h index f87e2ef43..478b79019 100644 --- a/include/mrbconf.h +++ b/include/mrbconf.h @@ -8,12 +8,19 @@ #define MRUBYCONF_H #include <stdint.h> +#define MRB_USE_FLOAT + +#ifdef MRB_USE_FLOAT +typedef float mrb_float; +#define readfloat(p) strtof((p),NULL) +#else typedef double mrb_float; +#define readfloat(p) strtod((p),NULL) +#endif + typedef int32_t mrb_int; typedef intptr_t mrb_sym; - #define readint(p,base) strtol((p),NULL,(base)) -#define readfloat(p) strtod((p),NULL) #undef INCLUDE_ENCODING /* not use encoding classes (ascii only) */ #define INCLUDE_ENCODING /* use UTF-8 encoding classes */ diff --git a/include/mruby/string.h b/include/mruby/string.h index ea9ca71ec..d35a5fe53 100644 --- a/include/mruby/string.h +++ b/include/mruby/string.h @@ -29,7 +29,7 @@ struct RString { long len; union { size_t capa; - mrb_value shared; + struct RString *shared; } aux; char *buf; }; |
