From a03116fc5b290e5af9a17e7a01558cd1d01ecde4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 14 Sep 2009 23:13:56 -0700 Subject: http: use rb_str_{update,flush} if available Rubinius supports these functions as of 039091066244cfcf483310b86b5c4989aaa6302b This allows the test_http_parser_ng.rb test to run under Rubinius db612aa62cad9e5cc41a4a4be645642362029d20 --- ext/unicorn_http/ext_help.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ext/unicorn_http/ext_help.h') diff --git a/ext/unicorn_http/ext_help.h b/ext/unicorn_http/ext_help.h index 8df2d80..d1b71d6 100644 --- a/ext/unicorn_http/ext_help.h +++ b/ext/unicorn_http/ext_help.h @@ -8,12 +8,18 @@ #define RSTRING_LEN(s) (RSTRING(s)->len) #endif +#ifndef RUBINIUS +# define rb_str_update(x) do {} while (0) +# define rb_str_flush(x) do {} while (0) +#endif /* !RUBINIUS */ + #ifndef HAVE_RB_STR_SET_LEN /* 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) { RSTRING(str)->len = len; RSTRING(str)->ptr[len] = '\0'; + rb_str_flush(str); } # define rb_str_set_len(str,len) rb_18_str_set_len(str,len) #endif -- cgit v1.2.3-24-ge0c7