summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-13 07:26:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-05-13 07:26:47 +0000
commitae2fe781dd4aae16a2f03a4b9fb93514eb9886d4 (patch)
treebc7b2f6399af854b2b7e3515916c5f51d970bf57 /array.c
parentad592443af373c3bbe61b41df106734856ad3072 (diff)
1.1b9_19
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/array.c b/array.c
index 529c936..61b6344 100644
--- a/array.c
+++ b/array.c
@@ -81,12 +81,22 @@ ary_new()
return ary_new2(ARY_DEFAULT_SIZE);
}
+#ifdef __STDC__
+#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
VALUE
+#ifdef __STDC__
+ary_new3(int n, ...)
+#else
ary_new3(n, va_alist)
int n;
va_dcl
+#endif
{
va_list ar;
VALUE ary;
@@ -97,7 +107,7 @@ ary_new3(n, va_alist)
}
ary = ary_new2(n<ARY_DEFAULT_SIZE?ARY_DEFAULT_SIZE:n);
- va_start(ar);
+ va_init_list(ar, n);
for (i=0; i<n; i++) {
RARRAY(ary)->ptr[i] = va_arg(ar, VALUE);
}