From c89ce4fb958d79009feb18cea39b14ddf8b11ff5 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 21 Nov 2009 22:35:28 -0800 Subject: http: Rubinius 0.13.0 compatibility fix 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. --- ext/unicorn_http/ext_help.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) */ -- cgit v1.2.3-24-ge0c7