ext/oj/oj.h in oj-3.13.23 vs ext/oj/oj.h in oj-3.14.0
- old
+ new
@@ -377,9 +377,15 @@
extern bool oj_use_hash_alt;
extern bool oj_use_array_alt;
extern bool string_writer_optimized;
+static inline VALUE oj_safe_string_convert(VALUE obj) {
+ VALUE rstr = rb_funcall(obj, oj_to_s_id, 0);
+ StringValue(rstr);
+ return rstr;
+}
+
#define APPEND_CHARS(buffer, chars, size) \
{ \
memcpy(buffer, chars, size); \
buffer += size; \
}