From 8ac3171981dcaae2d837ec472e687f2e8d79fd55 Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Wed, 28 Apr 2010 10:43:54 -0400 Subject: [PATCH] ensure compatibility with early releases of Ruby 1.8.5 (dfitzgibbon) RUBY-125 --- ext/cbson/cbson.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ext/cbson/cbson.c b/ext/cbson/cbson.c index 3f7b392..5ff6999 100644 --- a/ext/cbson/cbson.c +++ b/ext/cbson/cbson.c @@ -22,6 +22,23 @@ #include "ruby.h" +/* Ensure compatibility with early releases of Ruby 1.8.5 */ +#ifndef RSTRING_PTR +# define RSTRING_PTR(v) RSTRING(v)->ptr +#endif + +#ifndef RSTRING_LEN +# define RSTRING_LEN(v) RSTRING(v)->len +#endif + +#ifndef RARRAY_PTR +# define RARRAY_PTR(v) RARRAY(v)->ptr +#endif + +#ifndef RARRAY_LEN +# define RARRAY_LEN(v) RARRAY(v)->len +#endif + #if HAVE_RUBY_ST_H #include "ruby/st.h" #endif