diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2002-03-13 04:54:04 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2002-03-13 04:54:04 +0000 |
commit | d66d31914cbfff21a769d4e70b6b7245bed14410 (patch) | |
tree | 956122b89bcd74debb4d74d658e945c31ab82be8 /libc | |
parent | f2f500d61c071f14ad4eb0605482e62b8aec2b31 (diff) |
Apply Miles Bader's missing __va_copy() fix.
Diffstat (limited to 'libc')
-rw-r--r-- | libc/stdio/printf.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libc/stdio/printf.c b/libc/stdio/printf.c index ea066bb87..8efa7dd5b 100644 --- a/libc/stdio/printf.c +++ b/libc/stdio/printf.c @@ -468,7 +468,18 @@ void _ppfs_prepargs(register ppfs_t *ppfs, va_list arg) { int i; +#ifdef __va_copy __va_copy(ppfs->arg, arg); +#else + /* TODO -- maybe create a bits/vacopy.h for arch specific versions + * to ensure we get the right behavior? Either that or fall back + * on the portable (but costly in size) method of using a va_list *. + * That means a pointer derefs in the va_arg() invocations... */ +#warning __va_copy is not defined, using a simple copy instead... + /* the glibc manual suggests that this will usually suffice when + __va_copy doesn't exist. */ + ppfs->arg = arg; +#endif if ((i = ppfs->maxposarg) > 0) { /* init for positional args */ ppfs->num_data_args = i; |