diff options
| author | Toby Goodwin <toby@paccrat.org> | 2015-04-04 11:55:08 +0100 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:25 +0100 |
| commit | 8f6cdbf1e60d882598cd649000d13cd9859d8cc9 (patch) | |
| tree | c709b2f12e6d64856d56bc5904716f2a20350dd2 | |
| parent | b84c9e384eb97f3ca12700ecadd22bac86f4fe64 (diff) | |
s/__va_copy/va_copy/g
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | print.c | 12 | ||||
| -rw-r--r-- | proto.h | 10 |
3 files changed, 17 insertions, 11 deletions
@@ -858,3 +858,9 @@ Changes since rc-1.5b2 2015-04-03 Packaging: the rc.spec file was very out-of-date. + +2015-04-04 + + Portability: the comment from 1999-08-19 may well have been true at + the time, but the final version of the C99 standard called varargs + copying macro va_copy(). @@ -285,11 +285,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; } @@ -316,7 +316,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); @@ -361,7 +361,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; @@ -374,7 +374,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; @@ -23,11 +23,11 @@ typedef long align_t; #include <stdarg.h> -/* 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) +/* C 99 specifies a va_copy() macro to be used for copying +objects of type va_list. If this doesn't exist, hope that simple +assignment works. */ +#ifndef va_copy +#define va_copy(x,y) (x)=(y) #endif #if STDC_HEADERS |