diff options
Diffstat (limited to 'newlib/libc/stdio/fprintf.c')
-rw-r--r-- | newlib/libc/stdio/fprintf.c | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/newlib/libc/stdio/fprintf.c b/newlib/libc/stdio/fprintf.c index 56a0886..c33a42c 100644 --- a/newlib/libc/stdio/fprintf.c +++ b/newlib/libc/stdio/fprintf.c @@ -16,33 +16,39 @@ */ #include <_ansi.h> +#include <reent.h> #include <stdio.h> -#ifdef _HAVE_STDC #include <stdarg.h> -#else -#include <varargs.h> -#endif -#ifdef _HAVE_STDC int -fprintf(FILE * fp, _CONST char *fmt,...) -#else +_DEFUN(_fprintf_r, (ptr, fp, fmt), + struct _reent *ptr _AND + FILE *fp _AND + const char *fmt _DOTS) +{ + int ret; + va_list ap; + + va_start (ap, fmt); + ret = _vfprintf_r (ptr, fp, fmt, ap); + va_end (ap); + return ret; +} + +#ifndef _REENT_ONLY + int -fprintf(fp, fmt, va_alist) - FILE *fp; - char *fmt; - va_dcl -#endif +_DEFUN(fprintf, (fp, fmt), + FILE *fp _AND + const char *fmt _DOTS) { int ret; va_list ap; -#ifdef _HAVE_STDC va_start (ap, fmt); -#else - va_start (ap); -#endif - ret = vfprintf (fp, fmt, ap); + ret = _vfprintf_r (_REENT, fp, fmt, ap); va_end (ap); return ret; } + +#endif /* ! _REENT_ONLY */ |