about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-09-14 17:24:42 -0700
committerEric Wong <normalperson@yhbt.net>2009-09-14 23:17:55 -0700
commitfaeb894d1db8e6893405545f00ae5da01157015e (patch)
treecd3188a926d2a749989e7a4d78871b39b9f67b14 /ext
parentdbca9cc80d682305440ac4a94c5c72c8cf076021 (diff)
downloadunicorn-faeb894d1db8e6893405545f00ae5da01157015e.tar.gz
Hope they have the LL2NUM macro (Rubinius does)
Diffstat (limited to 'ext')
-rw-r--r--ext/unicorn_http/ext_help.h8
-rw-r--r--ext/unicorn_http/extconf.rb1
2 files changed, 9 insertions, 0 deletions
diff --git a/ext/unicorn_http/ext_help.h b/ext/unicorn_http/ext_help.h
index d8bfc7d..83e80a0 100644
--- a/ext/unicorn_http/ext_help.h
+++ b/ext/unicorn_http/ext_help.h
@@ -25,6 +25,14 @@ static void rb_18_str_set_len(VALUE str, long len)
 #  define assert_frozen(f) assert(!NIL_P(f))
 #endif
 
+#if !defined(OFFT2NUM)
+#  if SIZEOF_OFF_T == SIZEOF_LONG
+#    define OFFT2NUM(n) LONG2NUM(n)
+#  else
+#    define OFFT2NUM(n) LL2NUM(n)
+#  endif
+#endif /* ! defined(OFFT2NUM) */
+
 static inline int str_cstr_eq(VALUE val, const char *ptr, size_t len)
 {
   return (RSTRING_LEN(val) == len && !memcmp(ptr, RSTRING_PTR(val), len));
diff --git a/ext/unicorn_http/extconf.rb b/ext/unicorn_http/extconf.rb
index d65468d..2bf0f48 100644
--- a/ext/unicorn_http/extconf.rb
+++ b/ext/unicorn_http/extconf.rb
@@ -4,5 +4,6 @@ require 'mkmf'
 dir_config("unicorn_http")
 
 have_macro("SIZEOF_OFF_T", "ruby.h") or check_sizeof("off_t", "sys/types.h")
+have_macro("SIZEOF_LONG", "ruby.h") or check_sizeof("long", "sys/types.h")
 have_func("rb_str_set_len", "ruby.h")
 create_makefile("unicorn_http")