summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2012-09-10 23:00:30 -0700
committerYukihiro "Matz" Matsumoto <[email protected]>2012-09-10 23:00:30 -0700
commitbcd77200ac829311c745d260053ee9a3ec5d1f16 (patch)
tree1586296956a111642ade4ff77f271ae9d9872cbc /src/string.c
parent553b9405601a54e214aff0e2d0df73ac37d252f8 (diff)
parenta24fde1889125465c95c7641084252f2f389dca6 (diff)
downloadmruby-bcd77200ac829311c745d260053ee9a3ec5d1f16.tar.gz
mruby-bcd77200ac829311c745d260053ee9a3ec5d1f16.zip
Merge pull request #463 from emboss/define_dbl_dig_conditionally
Define DBL_DIG only if it wasn't previously defined
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index a454aab97..d8fe56790 100644
--- a/src/string.c
+++ b/src/string.c
@@ -2598,7 +2598,10 @@ mrb_cstr_to_dbl(mrb_state *mrb, const char * p, int badcheck)
double d;
// const char *ellipsis = "";
// int w;
-#define DBL_DIG 16
+#if !defined(DBL_DIG)
+ #define DBL_DIG 16
+#endif
+
enum {max_width = 20};
#define OutOfRange() (((w = end - p) > max_width) ? \
(w = max_width, ellipsis = "...") : \