summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-04-28 23:34:11 +0900
committerYukihiro Matsumoto <[email protected]>2012-04-28 23:34:11 +0900
commit0c5eba8936374a1206057170b72fb31e8f725bdb (patch)
treeea793c200b089beea902d0d37ece0ba2e3e8fe22 /include
parent2b6be163082927ecdfa203b68639a8ff303469e6 (diff)
downloadmruby-0c5eba8936374a1206057170b72fb31e8f725bdb.tar.gz
mruby-0c5eba8936374a1206057170b72fb31e8f725bdb.zip
strtof() may not be available on some platform; use strtod() then cast to float
Diffstat (limited to 'include')
-rw-r--r--include/mrbconf.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h
index 478b79019..4963634e3 100644
--- a/include/mrbconf.h
+++ b/include/mrbconf.h
@@ -8,15 +8,14 @@
#define MRUBYCONF_H
#include <stdint.h>
-#define MRB_USE_FLOAT
+#undef 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
+#define readfloat(p) (mrb_float)strtod((p),NULL)
typedef int32_t mrb_int;
typedef intptr_t mrb_sym;