summaryrefslogtreecommitdiff
path: root/include/ruby/ruby.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r--include/ruby/ruby.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 0959413dac..56aca0db5f 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1575,7 +1575,11 @@ rb_num2char_inline(VALUE x)
#define NUM2CHR(x) RB_NUM2CHR(x)
#define CHR2FIX(x) RB_CHR2FIX(x)
+#if SIZEOF_LONG < SIZEOF_VALUE
+#define RB_ST2FIX(h) RB_LONG2FIX((long)((h) > 0 ? (h) & (unsigned long)-1 >> 2 : (h) | ~((unsigned long)-1 >> 2)))
+#else
#define RB_ST2FIX(h) RB_LONG2FIX((long)(h))
+#endif
#define ST2FIX(h) RB_ST2FIX(h)
#define RB_ALLOC_N(type,n) ((type*)ruby_xmalloc2((size_t)(n),sizeof(type)))