summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/ruby/defines.h8
-rw-r--r--include/ruby/ruby.h6
2 files changed, 13 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
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index df5209f0bb..6d82afbc0e 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -115,6 +115,12 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
#define PRI_LONG_PREFIX "l"
#endif
+#if SIZEOF_LONG == 8
+#define PRI_64_PREFIX PRI_LONG_PREFIX
+#elif SIZEOF_LONG_LONG == 8
+#define PRI_64_PREFIX PRI_LL_PREFIX
+#endif
+
#if defined PRIdPTR && !defined PRI_VALUE_PREFIX
#define PRIdVALUE PRIdPTR
#define PRIoVALUE PRIoPTR