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

ruby-changes:49449

From: shyouhei <ko1@a...>
Date: Tue, 2 Jan 2018 21:39:34 +0900 (JST)
Subject: [ruby-changes:49449] shyouhei:r61548 (trunk): __VA_ARGS__ is a C99ism

shyouhei	2018-01-02 15:41:45 +0900 (Tue, 02 Jan 2018)

  New Revision: 61548

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

  Log:
    __VA_ARGS__ is a C99ism

  Modified files:
    trunk/include/ruby/ruby.h
    trunk/internal.h
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 61547)
+++ include/ruby/ruby.h	(revision 61548)
@@ -2172,7 +2172,7 @@ unsigned long ruby_strtoul(const char *s https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L2172
 PRINTF_ARGS(int ruby_snprintf(char *str, size_t n, char const *fmt, ...), 3, 4);
 int ruby_vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
 
-#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P) && defined(__OPTIMIZE__)
+#if defined(HAVE_BUILTIN___BUILTIN_CHOOSE_EXPR_CONSTANT_P) && defined(HAVE_VA_ARGS_MACRO) && defined(__OPTIMIZE__)
 # define rb_scan_args(argc,argvp,fmt,...) \
     __builtin_choose_expr(__builtin_constant_p(fmt), \
         rb_scan_args0(argc,argvp,fmt,\
@@ -2448,7 +2448,7 @@ rb_scan_args_set(int argc, const VALUE * https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L2448
 }
 #endif
 
-#if defined(__GNUC__) && defined(__OPTIMIZE__)
+#if defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO) && defined(__OPTIMIZE__)
 # define rb_yield_values(argc, ...) \
 __extension__({ \
 	const int rb_yield_values_argc = (argc); \
Index: internal.h
===================================================================
--- internal.h	(revision 61547)
+++ internal.h	(revision 61548)
@@ -1053,7 +1053,7 @@ VALUE rb_ary_aref1(VALUE ary, VALUE i); https://github.com/ruby/ruby/blob/trunk/internal.h#L1053
 VALUE rb_ary_aref2(VALUE ary, VALUE b, VALUE e);
 size_t rb_ary_memsize(VALUE);
 VALUE rb_to_array_type(VALUE obj);
-#ifdef __GNUC__
+#if defined(__GNUC__) && defined(HAVE_VA_ARGS_MACRO)
 #define rb_ary_new_from_args(n, ...) \
     __extension__ ({ \
 	const VALUE args_to_new_ary[] = {__VA_ARGS__}; \

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

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