summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2015-11-08 13:38:22 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2015-11-08 13:38:22 +0900
commit5bd7744c7d551abf01f54a2a6a8a4f006cd198e3 (patch)
tree91d559f4f8a27716fe0d588878e28ad6908adfc8 /ext
parent7b7b8a3392528e86a0e73da9639a368bee942b22 (diff)
downloadpsych-5bd7744c7d551abf01f54a2a6a8a4f006cd198e3.zip
backword compatibility of Ruby 2.0.0
Diffstat (limited to 'ext')
-rw-r--r--ext/psych/psych_emitter.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/psych/psych_emitter.c b/ext/psych/psych_emitter.c
index 67f54f1..29df96a 100644
--- a/ext/psych/psych_emitter.c
+++ b/ext/psych/psych_emitter.c
@@ -1,5 +1,12 @@
#include <psych.h>
+#if !defined(RARRAY_CONST_PTR)
+#define RARRAY_CONST_PTR(s) (const VALUE *)RARRAY_PTR(s)
+#endif
+#if !defined(RARRAY_AREF)
+#define RARRAY_AREF(a, i) RARRAY_CONST_PTR(a)[i]
+#endif
+
VALUE cPsychEmitter;
static ID id_write;
static ID id_line_width;