commit e9fc7b5a7c12eeb3bffbb170d7ff8a6649f93980
parent da4790fcdc1b9328f201c54827d97cb3c9393fa1
Author: tjg <tjg>
Date: Thu, 19 Aug 1999 09:29:59 +0000
Portability: the proposed C 9x __va_copy() macro is called that, not
va_copy(), as I thought. Furthermore, it is defined to be a macro, so
we don't need to use autoconf to check for it.
Diffstat:
6 files changed, 22 insertions(+), 32 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -598,6 +598,12 @@ Changes since rc-1.5b2
Tidiness: `make distclean' now removes sigmsgs.[ch].
-1995-05-28
+1999-05-28
Release: rc-1.6.
+
+1999-08-19
+
+ Portability: the proposed C 9x __va_copy() macro is called that, not
+ va_copy(), as I thought. Furthermore, it is defined to be a macro, so
+ we don't need to use autoconf to check for it.
diff --git a/README b/README
@@ -1,4 +1,4 @@
-This is a full release, rc-1.6.
+This is a snapshot release; the last full release was rc-1.6.
See COPYING for copying information. All files are
diff --git a/acinclude.m4 b/acinclude.m4
@@ -14,20 +14,6 @@ int main(void) {
])
-dnl Check for va_copy() in <stdarg.h>. This is new in C 9x.
-AC_DEFUN(RC_HAVE_VA_COPY, [
- AC_CACHE_CHECK(for va_copy(), rc_cv_have_va_copy, AC_EGREP_CPP(yes, [
-#include <stdarg.h>
-#ifdef va_copy
-yes
-#endif
-], rc_cv_have_va_copy=yes, rc_cv_have_va_copy=no))
- case "$rc_cv_have_va_copy" in
- yes) AC_DEFINE(HAVE_VA_COPY) ;;
- esac
-])
-
-
dnl We can't use AC_CHECK_FUNCS for sigsetjmp(), since it's a macro in
dnl some places.
AC_DEFUN(RC_FUNC_SIGSETJMP, [
diff --git a/configure.ac b/configure.ac
@@ -6,9 +6,9 @@ AC_DEFINE_UNQUOTED(RELDATE, "$RELDATE")
dnl Automake stuff.
dnl Use this one for snapshots...
-dnl AM_INIT_AUTOMAKE(rc, 1.5s`echo $RELDATE |sed 's/-//g'`)
+AM_INIT_AUTOMAKE(rc, 1.6s`echo $RELDATE |sed 's/-//g'`)
dnl ...and this one for releases
-AM_INIT_AUTOMAKE(rc, 1.6)
+dnl AM_INIT_AUTOMAKE(rc, 1.7)
AM_CONFIG_HEADER(config.h)
@@ -51,9 +51,9 @@ RC_TYPE_RLIM_T
RC_TYPE_SIG_ATOMIC_T
-dnl We prefer system calls that don't restart. If we have sigaction() and
-dnl SA_INTERRUPT, we'll use 'em. Otherwise, we check whether
-dnl good ol' signal() produces interruptible system calls.
+dnl We prefer system calls that don't restart. If we have sigaction()
+dnl and SA_INTERRUPT, we'll use 'em. Otherwise, we check whether good
+dnl ol' signal() produces interruptible system calls.
RC_FUNC_SIGACTION
case "$rc_cv_sa_int" in
yes) AC_DEFINE(HAVE_SA_INTERRUPT) ;;
@@ -86,8 +86,6 @@ yes) AC_DEFINE(HAVE_FIFO) ;;
no) RC_SYS_MKNOD_FIFO ;;
esac
-RC_HAVE_VA_COPY
-
dnl Now handle arguments.
AC_ARG_ENABLE(builtin-echo, [ --disable-builtin-echo Don't include \`echo' as a builtin],
test "x$enableval" != "xno" && AC_DEFINE(RC_ECHO),
diff --git a/print.c b/print.c
@@ -289,11 +289,11 @@ extern int fmtprint(Format *format, const char *fmt,...) {
va_list ap, saveargs;
va_start(ap, fmt);
- va_copy(saveargs, format->args);
- va_copy(format->args, ap);
+ __va_copy(saveargs, format->args);
+ __va_copy(format->args, ap);
n += printfmt(format, fmt);
va_end(format->args);
- va_copy(format->args, saveargs);
+ __va_copy(format->args, saveargs);
return n + format->flushed;
}
@@ -320,7 +320,7 @@ extern int fprint(int fd, const char *fmt,...) {
format.u.n = fd;
va_start(ap, fmt);
- va_copy(format.args, ap);
+ __va_copy(format.args, ap);
printfmt(&format, fmt);
va_end(format.args);
@@ -365,7 +365,7 @@ extern char *mprint(const char *fmt,...) {
format.u.n = 1;
va_start(ap, fmt);
- va_copy(format.args, ap);
+ __va_copy(format.args, ap);
result = memprint(&format, fmt, ealloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
va_end(format.args);
return result;
@@ -378,7 +378,7 @@ extern char *nprint(const char *fmt,...) {
format.u.n = 0;
va_start(ap, fmt);
- va_copy(format.args, ap);
+ __va_copy(format.args, ap);
result = memprint(&format, fmt, nalloc(PRINT_ALLOCSIZE), PRINT_ALLOCSIZE);
va_end(format.args);
return result;
diff --git a/proto.h b/proto.h
@@ -23,11 +23,11 @@ typedef long align_t;
#include <stdarg.h>
-/* C 9x specifies a va_copy() macro which should be used for copying
+/* C 9x specifies a __va_copy() macro which should be used for copying
objects of type va_list. Of course, most places don't have this yet,
but where it does exist we need to use it. */
-#ifndef va_copy
-#define va_copy(x,y) (x)=(y)
+#ifndef __va_copy
+#define __va_copy(x,y) (x)=(y)
#endif
#if STDC_HEADERS