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

ruby-changes:61195

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Mon, 11 May 2020 14:57:26 +0900 (JST)
Subject: [ruby-changes:61195] 233c2018f1 (master): drop varargs.h support

https://git.ruby-lang.org/ruby.git/commit/?id=233c2018f1

From 233c2018f1b873a441af22848cee6dedaed3ad72 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Mon, 11 May 2020 14:27:25 +0900
Subject: drop varargs.h support

This header file is simply out of date (for decades since at least
1989).  It's the 21st century.  Just stop using it.

diff --git a/compile.c b/compile.c
index 01a740e..3474a8f 100644
--- a/compile.c
+++ b/compile.c
@@ -1209,7 +1209,7 @@ new_insn_body(rb_iseq_t *iseq, int line_no, enum ruby_vminsn_type insn_id, int a https://github.com/ruby/ruby/blob/trunk/compile.c#L1209
     va_list argv;
     if (argc > 0) {
 	int i;
-	va_init_list(argv, argc);
+        va_start(argv, argc);
         operands = compile_data_alloc2(iseq, sizeof(VALUE), argc);
 	for (i = 0; i < argc; i++) {
 	    VALUE v = va_arg(argv, VALUE);
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 9ca521a..2480e2e 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -15,11 +15,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L15
 #include "ruby/internal/config.h"
 #include "ruby/defines.h"
 
-#ifdef HAVE_STDARG_PROTOTYPES
-# include <stdarg.h>
-#else
-# include <varargs.h>
-#endif
+#include <stdarg.h>
 
 #include "ruby/st.h"
 
diff --git a/vm_core.h b/vm_core.h
index 3d9b190..e725e4d 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -49,14 +49,7 @@ https://github.com/ruby/ruby/blob/trunk/vm_core.h#L49
 
 #include <stddef.h>
 #include <signal.h>
-
-#ifdef HAVE_STDARG_PROTOTYPES
 #include <stdarg.h>
-#define va_init_list(a,b) va_start((a),(b))
-#else
-#include <varargs.h>
-#define va_init_list(a,b) va_start((a))
-#endif
 
 #include "ruby_assert.h"
 
diff --git a/vm_eval.c b/vm_eval.c
index 49cc927..80b3e90 100644
--- a/vm_eval.c
+++ b/vm_eval.c
@@ -891,7 +891,7 @@ rb_funcall(VALUE recv, ID mid, int n, ...) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L891
     if (n > 0) {
 	long i;
 
-	va_init_list(ar, n);
+        va_start(ar, n);
 
 	argv = ALLOCA_N(VALUE, n);
 
@@ -1163,7 +1163,7 @@ rb_yield_values(int n, ...) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L1163
 	va_list args;
 	argv = ALLOCA_N(VALUE, n);
 
-	va_init_list(args, n);
+        va_start(args, n);
 	for (i=0; i<n; i++) {
 	    argv[i] = va_arg(args, VALUE);
 	}
-- 
cgit v0.10.2


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

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