aboutsummaryrefslogtreecommitdiffstats
path: root/include/ruby/defines.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-18 09:46:01 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-18 09:46:01 +0000
commit1a6a65f16bb8f9f8035dc8d4689ec0b6032047d0 (patch)
tree7c4a486219dc84f02865e2da98c7d943185c3ffa /include/ruby/defines.h
parentca7bdc882bab78fffc91244496fd2c797018d881 (diff)
downloadruby-1a6a65f16bb8f9f8035dc8d4689ec0b6032047d0.tar.gz
* configure.in: Check __int128.
* include/ruby/defines.h (BDIGIT_DBL): Use uint128_t if it is available. (BDIGIT): Use uint64_t if uint128_t is available. (SIZEOF_BDIGITS): Defined for above case. (BDIGIT_DBL_SIGNED): Ditto. (PRI_BDIGIT_PREFIX): Ditto. * include/ruby/ruby.h (PRI_64_PREFIX): Defined. * bignum.c (rb_big_pow): Don't use BITSPERDIG for the condition which rb_big_pow returns Float or Bignum. [ruby-dev:47413] [Feature #8509] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/defines.h')
-rw-r--r--include/ruby/defines.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index 9b75647e64..0c6b2300fc 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -141,7 +141,13 @@ void xfree(void*);
# define SIZEOF_LONG_LONG SIZEOF___INT64
#endif
-#if SIZEOF_INT*2 <= SIZEOF_LONG_LONG
+#if defined(HAVE_INT64_T) && defined(HAVE_INT128_T)
+# define BDIGIT uint64_t
+# define SIZEOF_BDIGITS SIZEOF_INT64_T
+# define BDIGIT_DBL uint128_t
+# define BDIGIT_DBL_SIGNED int128_t
+# define PRI_BDIGIT_PREFIX PRI_64_PREFIX
+#elif SIZEOF_INT*2 <= SIZEOF_LONG_LONG
# define BDIGIT unsigned int
# define SIZEOF_BDIGITS SIZEOF_INT
# define BDIGIT_DBL unsigned LONG_LONG