summaryrefslogtreecommitdiff
path: root/ext/json/parser/parser.h
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-10 08:01:04 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-10 08:01:04 +0000
commita2e497d5ede45bd4f4a57f494027020d7bd1733b (patch)
tree9773233b59c71615a1b88fd5807b30d2e0f09345 /ext/json/parser/parser.h
parenta119b9d146fea877acc1e9ba5df0702163ce917a (diff)
* ext/json: Merge json gem 1.5.4+ (f7f78896607b6f6226cd).
[Bug #4700] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json/parser/parser.h')
-rw-r--r--ext/json/parser/parser.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/ext/json/parser/parser.h b/ext/json/parser/parser.h
index a344da058c4..f2ce5a4c2fc 100644
--- a/ext/json/parser/parser.h
+++ b/ext/json/parser/parser.h
@@ -9,18 +9,23 @@
#ifdef HAVE_RUBY_ENCODING_H
#include "ruby/encoding.h"
-#define FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())
+#define FORCE_UTF8(obj) ((obj) = rb_enc_associate(rb_str_dup(obj), rb_utf8_encoding()))
#else
#define FORCE_UTF8(obj)
#endif
+#ifdef HAVE_RUBY_ST_H
+#include "ruby/st.h"
+#else
+#include "st.h"
+#endif
#define option_given_p(opts, key) RTEST(rb_funcall(opts, i_key_p, 1, key))
/* unicode */
-typedef unsigned long UTF32; /* at least 32 bits */
-typedef unsigned short UTF16; /* at least 16 bits */
-typedef unsigned char UTF8; /* typically 8 bits */
+typedef unsigned long UTF32; /* at least 32 bits */
+typedef unsigned short UTF16; /* at least 16 bits */
+typedef unsigned char UTF8; /* typically 8 bits */
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
#define UNI_SUR_HIGH_START (UTF32)0xD800
@@ -41,6 +46,8 @@ typedef struct JSON_ParserStruct {
int symbolize_names;
VALUE object_class;
VALUE array_class;
+ int create_additions;
+ VALUE match_string;
} JSON_Parser;
#define GET_PARSER \