summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/ruby.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 50b20845f1..c9544fa510 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -258,6 +258,22 @@ VALUE rb_ull2inum(unsigned LONG_LONG);
# define SSIZET2NUM(v) INT2NUM(v)
#endif
+#ifndef SIZE_MAX
+# if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
+# define SIZE_MAX ULLONG_MAX
+# define SIZE_MIN ULLONG_MIN
+# elif SIZEOF_SIZE_T == SIZEOF_LONG
+# define SIZE_MAX ULONG_MAX
+# define SIZE_MIN ULONG_MIN
+# elif SIZEOF_SIZE_T == SIZEOF_INT
+# define SIZE_MAX UINT_MAX
+# define SIZE_MIN UINT_MIN
+# else
+# define SIZE_MAX USHRT_MAX
+# define SIZE_MIN USHRT_MIN
+# endif
+#endif
+
#ifndef SSIZE_MAX
# if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
# define SSIZE_MAX LLONG_MAX