ext/crc32/crc32.c in fiveruns-memcache-client-1.5.0.3 vs ext/crc32/crc32.c in fiveruns-memcache-client-1.5.0.4

- old
+ new

@@ -1,11 +1,21 @@ #include "ruby.h" #include "stdio.h" static VALUE t_itu_t(VALUE self, VALUE string) { VALUE str = StringValue(string); +#ifdef RSTRING_LEN + int n = RSTRING_LEN(str); +#else int n = RSTRING(str)->len; +#endif + +#ifdef RSTRING_PTR + char* p = RSTRING_PTR(str); +#else char* p = RSTRING(str)->ptr; +#endif + unsigned long r = 0xFFFFFFFF; int i, j; for (i = 0; i < n; i++) { r = r ^ p[i];