summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-18 06:24:38 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-18 06:24:38 (GMT)
commit5c0df05b92de528a397d29fd9ca5dca534b4c930 (patch)
tree27a206af5521705604589bfc8251011ecd73807b /ext/json
parentb38c0b7974854003a949a26f87bd7ff0e17113ef (diff)
parser.rl: define enc_raise iff necessary
* ext/json/parser/parser.rl (enc_raise): no needs if rb_enc_raise is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/parser/parser.c4
-rw-r--r--ext/json/parser/parser.rl4
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/json/parser/parser.c b/ext/json/parser/parser.c
index 26ca21a..f3ede6f 100644
--- a/ext/json/parser/parser.c
+++ b/ext/json/parser/parser.c
@@ -4,7 +4,7 @@
#include "parser.h"
#if defined HAVE_RUBY_ENCODING_H
-# define EXC_ENCODING UTF8,
+# define EXC_ENCODING UTF_8,
# ifndef HAVE_RB_ENC_RAISE
static void
enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
@@ -18,8 +18,8 @@ enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
rb_exc_raise(rb_exc_new3(exc, mesg));
}
+# define rb_enc_raise enc_raise
# endif
-# define rb_enc_raise enc_raise
#else
# define EXC_ENCODING /* nothing */
# define rb_enc_raise rb_raise
diff --git a/ext/json/parser/parser.rl b/ext/json/parser/parser.rl
index 7285518..0516aff 100644
--- a/ext/json/parser/parser.rl
+++ b/ext/json/parser/parser.rl
@@ -2,7 +2,7 @@
#include "parser.h"
#if defined HAVE_RUBY_ENCODING_H
-# define EXC_ENCODING UTF8,
+# define EXC_ENCODING UTF_8,
# ifndef HAVE_RB_ENC_RAISE
static void
enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
@@ -16,8 +16,8 @@ enc_raise(rb_encoding *enc, VALUE exc, const char *fmt, ...)
rb_exc_raise(rb_exc_new3(exc, mesg));
}
+# define rb_enc_raise enc_raise
# endif
-# define rb_enc_raise enc_raise
#else
# define EXC_ENCODING /* nothing */
# define rb_enc_raise rb_raise