[前][次][番号順一覧][スレッド一覧]

ruby-changes:38262

From: nobu <ko1@a...>
Date: Sat, 18 Apr 2015 15:24:43 +0900 (JST)
Subject: [ruby-changes:38262] nobu:r50343 (trunk): parser.rl: define enc_raise iff necessary

nobu	2015-04-18 15:24:38 +0900 (Sat, 18 Apr 2015)

  New Revision: 50343

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50343

  Log:
    parser.rl: define enc_raise iff necessary
    
    * ext/json/parser/parser.rl (enc_raise): no needs if rb_enc_raise
      is available.

  Modified files:
    trunk/ext/json/parser/parser.c
    trunk/ext/json/parser/parser.rl
Index: ext/json/parser/parser.rl
===================================================================
--- ext/json/parser/parser.rl	(revision 50342)
+++ ext/json/parser/parser.rl	(revision 50343)
@@ -2,7 +2,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/json/parser/parser.rl#L2
 #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, c https://github.com/ruby/ruby/blob/trunk/ext/json/parser/parser.rl#L16
 
     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
Index: ext/json/parser/parser.c
===================================================================
--- ext/json/parser/parser.c	(revision 50342)
+++ ext/json/parser/parser.c	(revision 50343)
@@ -4,7 +4,7 @@ https://github.com/ruby/ruby/blob/trunk/ext/json/parser/parser.c#L4
 #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, c https://github.com/ruby/ruby/blob/trunk/ext/json/parser/parser.c#L18
 
     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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]