about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-21 22:35:28 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-21 22:35:28 -0800
commitc89ce4fb958d79009feb18cea39b14ddf8b11ff5 (patch)
treedd83a4eeeb3176b3b3d9adbccd1cbe8915939a29 /ext
parent7bb2b69b55973bd55c2668a39e86381aa945f665 (diff)
downloadunicorn-c89ce4fb958d79009feb18cea39b14ddf8b11ff5.tar.gz
Rubinius appears to have changed semantics and our
rb_str_set_len() emulation doesn't work anymore.  Since
rb_str_set_len() is just an optimized version of
rb_str_resize(), we'll just use rb_str_resize() for now
unless we notice something better.

test_http_parser and test_http_parser_ng tests pass under
Rubinius 0.13.0.
Diffstat (limited to 'ext')
-rw-r--r--ext/unicorn_http/ext_help.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/unicorn_http/ext_help.h b/ext/unicorn_http/ext_help.h
index 81bb936..7df73f7 100644
--- a/ext/unicorn_http/ext_help.h
+++ b/ext/unicorn_http/ext_help.h
@@ -14,6 +14,9 @@
 #endif /* !RUBINIUS */
 
 #ifndef HAVE_RB_STR_SET_LEN
+#  ifdef RUBINIUS
+#    define rb_str_set_len(str,len) rb_str_resize(str,len)
+#  else /* 1.8.6 optimized version */
 /* this is taken from Ruby 1.8.7, 1.8.6 may not have it */
 static void rb_18_str_set_len(VALUE str, long len)
 {
@@ -21,7 +24,8 @@ static void rb_18_str_set_len(VALUE str, long len)
   RSTRING(str)->ptr[len] = '\0';
   rb_str_flush(str);
 }
-#  define rb_str_set_len(str,len) rb_18_str_set_len(str,len)
+#    define rb_str_set_len(str,len) rb_18_str_set_len(str,len)
+#  endif /* ! RUBINIUS */
 #endif /* !defined(HAVE_RB_STR_SET_LEN) */
 
 /* not all Ruby implementations support frozen objects (Rubinius does not) */