summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-12-03 18:47:04 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2016-12-03 18:47:04 +0900
commita0fbc46ccd3e129532b05a9fe4f13f42a3c349b2 (patch)
treef3196f462149109c467e6ad6b1bf677d03e48112 /include
parent802e396466142698af401f9700bfa61e67024074 (diff)
downloadmruby-a0fbc46ccd3e129532b05a9fe4f13f42a3c349b2.tar.gz
mruby-a0fbc46ccd3e129532b05a9fe4f13f42a3c349b2.zip
Import locale insensitive strtod() from Ruby1.8; fix #3270
The function was renamed to `mrb_float_read(const char*, char**)`.
Diffstat (limited to 'include')
-rw-r--r--include/mruby/value.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/mruby/value.h b/include/mruby/value.h
index 61110e3dd..54d197f8f 100644
--- a/include/mruby/value.h
+++ b/include/mruby/value.h
@@ -62,12 +62,12 @@ struct mrb_state;
# define MRB_PRIx PRIx32
#endif
+
+MRB_API double mrb_float_read(const char*, char**);
#ifdef MRB_USE_FLOAT
typedef float mrb_float;
-# define str_to_mrb_float(buf) strtof(buf, NULL)
#else
typedef double mrb_float;
-# define str_to_mrb_float(buf) strtod(buf, NULL)
#endif
#if defined _MSC_VER && _MSC_VER < 1900
@@ -85,7 +85,6 @@ MRB_API int mrb_msvc_snprintf(char *s, size_t n, const char *format, ...);
# define isnan _isnan
# define isinf(n) (!_finite(n) && !_isnan(n))
# define signbit(n) (_copysign(1.0, (n)) < 0.0)
-# define strtof (float)strtod
static const unsigned int IEEE754_INFINITY_BITS_SINGLE = 0x7F800000;
# define INFINITY (*(float *)&IEEE754_INFINITY_BITS_SINGLE)
# define NAN ((float)(INFINITY - INFINITY))