diff loadagent/libprintf/sprintf.c @ 3:45bf8af5f061

libprintf brought in from older PPC/m68k code, but fucking GCC refuses to compile <varargs.h> - need to convert to Anshit C <stdarg.h>
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 29 Apr 2013 07:00:22 +0000
parents
children 5c7b3d5d5702
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/loadagent/libprintf/sprintf.c	Mon Apr 29 07:00:22 2013 +0000
@@ -0,0 +1,21 @@
+#include <varargs.h>
+
+extern void _sprintf_putchar();
+
+int
+sprintf(va_alist)
+	va_dcl
+{
+	va_list ap;
+	char *strptr;
+	char *fmt;
+	int len;
+
+	va_start(ap);
+	strptr = va_arg(ap, char *);
+	fmt = va_arg(ap, char *);
+	len = _doprnt(fmt, ap, &_sprintf_putchar, &strptr);
+	*strptr = '\0';
+	va_end(ap);
+	return(len);
+}