diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-09-10 23:00:30 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2012-09-10 23:00:30 -0700 |
| commit | bcd77200ac829311c745d260053ee9a3ec5d1f16 (patch) | |
| tree | 1586296956a111642ade4ff77f271ae9d9872cbc | |
| parent | 553b9405601a54e214aff0e2d0df73ac37d252f8 (diff) | |
| parent | a24fde1889125465c95c7641084252f2f389dca6 (diff) | |
| download | mruby-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
| -rw-r--r-- | src/string.c | 5 |
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 = "...") : \ |
