summaryrefslogtreecommitdiff
path: root/ext/json/fbuffer/fbuffer.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-15 08:16:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-15 08:16:46 +0000
commitcfa2a21062c113f40fefe8a31ef72121ec987900 (patch)
tree4df47f01a24b7e0047d8f19af1507fd1290c6a91 /ext/json/fbuffer/fbuffer.h
parenta1a237fb36d4b78548d2aa94f03a6c460e50b4a7 (diff)
ext/json: backward compatibilities
* ext/json/fbuffer/fbuffer.h, ext/json/generator/generator.c: add macros for backward compatibilities. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json/fbuffer/fbuffer.h')
-rw-r--r--ext/json/fbuffer/fbuffer.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/json/fbuffer/fbuffer.h b/ext/json/fbuffer/fbuffer.h
index af74187566..1e860eb790 100644
--- a/ext/json/fbuffer/fbuffer.h
+++ b/ext/json/fbuffer/fbuffer.h
@@ -25,6 +25,15 @@
#define RSTRING_LEN(string) RSTRING(string)->len
#endif
+#ifdef PRIsVALUE
+# define RB_OBJ_CLASSNAME(obj) rb_obj_class(obj)
+# define RB_OBJ_STRING(obj) (obj)
+#else
+# define PRIsVALUE "s"
+# define RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj)
+# define RB_OBJ_STRING(obj) StringValueCStr(obj)
+#endif
+
#ifdef HAVE_RUBY_ENCODING_H
#include "ruby/encoding.h"
#define FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())