4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-27 01:27:21 +08:00
Ben Elliston c7cd784974 * libc/machine/spu/vsnprintf.c (c99_vsnprintf_t): Const-qualify
fmt member.
	* libc/machine/spu/printf.c (c99_printf_t): Likewise.
	(printf): Pass fmt to va_start to suppress a warning.
2007-01-30 03:18:52 +00:00

52 lines
682 B
C

#include <_ansi.h>
#include <stdio.h>
#include "c99ppe.h"
#ifdef _HAVE_STDC
#include <stdarg.h>
#else
#include <varargs.h>
#endif
typedef struct
{
char* fmt;
unsigned int pad0[ 3 ];
va_list ap;
} c99_printf_t;
#ifndef _REENT_ONLY
#ifdef _HAVE_STDC
int
_DEFUN (printf, (fmt,ap),
_CONST char *fmt _AND
...)
#else
int
#error
printf (fmt, va_alist)
_CONST char *fmt;
va_dcl
#endif
{
int* ret;
c99_printf_t args;
ret = (int*) &args;
args.fmt = fmt;
#ifdef _HAVE_STDC
va_start (args.ap, fmt);
#else
va_start (args.ap);
#endif
send_to_ppe(SPE_C99_SIGNALCODE, SPE_C99_VPRINTF, &args);
va_end (args.ap);
return *ret;
}
#endif /* ! _REENT_ONLY */