diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-04-27 18:31:45 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-04-27 18:31:45 +0900 |
| commit | ee30c5a4a44fc26a8b5b8d6a0e35a7a4b6a6be50 (patch) | |
| tree | 0ec0d2764b0bb6e0a2067d20a238f8b2176e130c /include | |
| parent | c8f8f8396ce98b37de5e160655bc6219c13d8248 (diff) | |
| download | mruby-ee30c5a4a44fc26a8b5b8d6a0e35a7a4b6a6be50.tar.gz mruby-ee30c5a4a44fc26a8b5b8d6a0e35a7a4b6a6be50.zip | |
allow float/double switch
Diffstat (limited to 'include')
| -rw-r--r-- | include/mrbconf.h | 11 |
1 files changed, 9 insertions, 2 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 */ |
