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

ruby-changes:46256

From: nobu <ko1@a...>
Date: Mon, 17 Apr 2017 10:36:00 +0900 (JST)
Subject: [ruby-changes:46256] nobu:r58378 (trunk): parse.y: fix for empty `__VA_ARGS__`

nobu	2017-04-17 10:35:54 +0900 (Mon, 17 Apr 2017)

  New Revision: 58378

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

  Log:
    parse.y: fix for empty `__VA_ARGS__`
    
    * parse.y (WARN_CALL, WARNING_CALL): need `##` between a comman
      and `__VA_ARGS__` in the case it is empty, not to end arguments
      with a comma.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 58377)
+++ parse.y	(revision 58378)
@@ -832,14 +832,14 @@ static ID id_warn, id_warning, id_gets; https://github.com/ruby/ruby/blob/trunk/parse.y#L832
 # define WARN_ARGS(fmt,n) parser->value, id_warn, n, rb_usascii_str_new_lit(fmt)
 # define WARN_ARGS_L(l,fmt,n) WARN_ARGS(fmt,n)
 # ifdef HAVE_VA_ARGS_MACRO
-# define WARN_CALL(args,...) rb_funcall(args,__VA_ARGS__)
+# define WARN_CALL(args,...) rb_funcall(args,##__VA_ARGS__)
 # else
 # define WARN_CALL rb_funcall
 # endif
 # define WARNING_ARGS(fmt,n) parser->value, id_warning, n, rb_usascii_str_new_lit(fmt)
 # define WARNING_ARGS_L(l, fmt,n) WARNING_ARGS(fmt,n)
 # ifdef HAVE_VA_ARGS_MACRO
-# define WARNING_CALL(args,...) rb_funcall(args,__VA_ARGS__)
+# define WARNING_CALL(args,...) rb_funcall(args,##__VA_ARGS__)
 # else
 # define WARNING_CALL rb_funcall
 # endif

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

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