diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-20 15:42:23 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-20 15:42:23 +0000 |
commit | a461f2f8bb5b79954421b6b3d3756f9011ad32e9 (patch) | |
tree | e3a0b2d63fa0ef198afba91fc127fa7ea8512e4d /ext/bigdecimal/bigdecimal.h | |
parent | a0d42f035421dabf54500ef83a34df2bf09573ea (diff) |
* ext/bigdecimal: Workaround fix for bigdecimal test failures caused
by [ruby-dev:47413] [Feature #8509]
* ext/bigdecimal/bigdecimal.h (BDIGIT): Make it independent from the
definition for bignum.c.
(SIZEOF_BDIGITS): Ditto.
(BDIGIT_DBL): Ditto.
(BDIGIT_DBL_SIGNED): Ditto.
(PRI_BDIGIT_PREFIX): Undefine the definition.
(PRI_BDIGIT_DBL_PREFIX): Ditto.
* ext/bigdecimal/bigdecimal.c (RBIGNUM_ZERO_P): Use rb_bigzero_p.
(bigzero_p): Removed.
(is_even): Use rb_big_pack.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/bigdecimal.h')
-rw-r--r-- | ext/bigdecimal/bigdecimal.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ext/bigdecimal/bigdecimal.h b/ext/bigdecimal/bigdecimal.h index ae32d5ffc5..a53ad47e81 100644 --- a/ext/bigdecimal/bigdecimal.h +++ b/ext/bigdecimal/bigdecimal.h @@ -19,6 +19,25 @@ #include "ruby/ruby.h" #include <float.h> +#undef BDIGIT +#undef SIZEOF_BDIGITS +#undef BDIGIT_DBL +#undef BDIGIT_DBL_SIGNED +#undef PRI_BDIGIT_PREFIX +#undef PRI_BDIGIT_DBL_PREFIX + +#ifdef HAVE_INT64_T +# define BDIGIT uint32_t +# define BDIGIT_DBL uint64_t +# define BDIGIT_DBL_SIGNED int64_t +# define SIZEOF_BDIGITS 4 +#else +# define BDIGIT uint16_t +# define BDIGIT_DBL uint32_t +# define BDIGIT_DBL_SIGNED int32_t +# define SIZEOF_BDIGITS 2 +#endif + #if defined(__cplusplus) extern "C" { #if 0 |