From 77a951c5da518dda471282635c98f3b572ca15db Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 5 May 2011 16:42:26 -0700 Subject: http_parser: add max_header_len accessor Rainbows! wants to be able to lower this eventually... --- ext/unicorn_http/ext_help.h | 16 ++++++++++++++++ 1 file changed, 16 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 1f76f54..0968080 100644 --- a/ext/unicorn_http/ext_help.h +++ b/ext/unicorn_http/ext_help.h @@ -36,6 +36,22 @@ static void rb_18_str_set_len(VALUE str, long len) # endif #endif /* ! defined(OFFT2NUM) */ +#if !defined(SIZET2NUM) +# if SIZEOF_SIZE_T == SIZEOF_LONG +# define SIZET2NUM(n) ULONG2NUM(n) +# else +# define SIZET2NUM(n) ULL2NUM(n) +# endif +#endif /* ! defined(SIZET2NUM) */ + +#if !defined(NUM2SIZET) +# if SIZEOF_SIZE_T == SIZEOF_LONG +# define NUM2SIZET(n) ((size_t)NUM2ULONG(n)) +# else +# define NUM2SIZET(n) ((size_t)NUM2ULL(n)) +# endif +#endif /* ! defined(NUM2SIZET) */ + #ifndef HAVE_RB_STR_MODIFY # define rb_str_modify(x) do {} while (0) #endif /* ! defined(HAVE_RB_STR_MODIFY) */ -- cgit v1.2.3-24-ge0c7