diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-11-21 22:35:28 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-11-21 22:35:28 -0800 |
commit | c89ce4fb958d79009feb18cea39b14ddf8b11ff5 (patch) | |
tree | dd83a4eeeb3176b3b3d9adbccd1cbe8915939a29 /ext | |
parent | 7bb2b69b55973bd55c2668a39e86381aa945f665 (diff) | |
download | unicorn-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.h | 6 |
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) */ |