Skip to content

Commit 8ac3171

Browse files
committed
ensure compatibility with early releases of Ruby 1.8.5 (dfitzgibbon) RUBY-125
1 parent 56ecc47 commit 8ac3171

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

ext/cbson/cbson.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@
2222

2323
#include "ruby.h"
2424

25+
/* Ensure compatibility with early releases of Ruby 1.8.5 */
26+
#ifndef RSTRING_PTR
27+
# define RSTRING_PTR(v) RSTRING(v)->ptr
28+
#endif
29+
30+
#ifndef RSTRING_LEN
31+
# define RSTRING_LEN(v) RSTRING(v)->len
32+
#endif
33+
34+
#ifndef RARRAY_PTR
35+
# define RARRAY_PTR(v) RARRAY(v)->ptr
36+
#endif
37+
38+
#ifndef RARRAY_LEN
39+
# define RARRAY_LEN(v) RARRAY(v)->len
40+
#endif
41+
2542
#if HAVE_RUBY_ST_H
2643
#include "ruby/st.h"
2744
#endif

0 commit comments

Comments
 (0)