about summary refs log tree commit homepage
path: root/ext/unicorn_http/ext_help.h
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-05-05 16:42:26 -0700
committerEric Wong <normalperson@yhbt.net>2011-05-05 16:42:26 -0700
commit77a951c5da518dda471282635c98f3b572ca15db (patch)
tree7e87f472c615c6e5522d5a5efc79fe4c5cb7bd18 /ext/unicorn_http/ext_help.h
parent733cb68e444a6f324bb1ffda3839da98ef010c74 (diff)
downloadunicorn-77a951c5da518dda471282635c98f3b572ca15db.tar.gz
Rainbows! wants to be able to lower this eventually...
Diffstat (limited to 'ext/unicorn_http/ext_help.h')
-rw-r--r--ext/unicorn_http/ext_help.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/unicorn_http/ext_help.h b/ext/unicorn_http/ext_help.h
index 1f76f54..0968080 100644
--- a/ext/unicorn_http/ext_help.h
+++ b/ext/unicorn_http/ext_help.h
@@ -36,6 +36,22 @@ static void rb_18_str_set_len(VALUE str, long len)
 #  endif
 #endif /* ! defined(OFFT2NUM) */
 
+#if !defined(SIZET2NUM)
+#  if SIZEOF_SIZE_T == SIZEOF_LONG
+#    define SIZET2NUM(n) ULONG2NUM(n)
+#  else
+#    define SIZET2NUM(n) ULL2NUM(n)
+#  endif
+#endif /* ! defined(SIZET2NUM) */
+
+#if !defined(NUM2SIZET)
+#  if SIZEOF_SIZE_T == SIZEOF_LONG
+#    define NUM2SIZET(n) ((size_t)NUM2ULONG(n))
+#  else
+#    define NUM2SIZET(n) ((size_t)NUM2ULL(n))
+#  endif
+#endif /* ! defined(NUM2SIZET) */
+
 #ifndef HAVE_RB_STR_MODIFY
 #  define rb_str_modify(x) do {} while (0)
 #endif /* ! defined(HAVE_RB_STR_MODIFY) */