More printf de-duplication.
Fix the 'j' (intmax_t/uintmax_t) length qualifier in the wide
variant. (With new tests that fail without this fix.)
Fix a typo in the wide support for intmax_t*, which isn't testable because
%n is disabled on Android (and will be removed in a later cleanup pass).
Also move the public vfprintf/vfwprint functions into stdio.cpp.
Bug: http://b/67371539
Test: ran tests
Change-Id: Ib003599b1e9cb789044a068940b59e447f2cb7cb
diff --git a/libc/stdio/vfprintf.cpp b/libc/stdio/vfprintf.cpp
index 6d16828..10303d9 100644
--- a/libc/stdio/vfprintf.cpp
+++ b/libc/stdio/vfprintf.cpp
@@ -83,7 +83,7 @@
wchar_t* pwchararg;
};
-static int __find_arguments(const char* fmt0, va_list ap, union arg** argtable, size_t* argtablesiz);
+static int __find_arguments(const CHAR_TYPE* fmt0, va_list ap, union arg** argtable, size_t* argtablesiz);
static int __grow_type_table(unsigned char** typetable, int* tablesize);
/*
@@ -250,16 +250,6 @@
#define CHARINT 0x0800 /* 8 bit integer */
#define MAXINT 0x1000 /* largest integer size (intmax_t) */
-int vfprintf(FILE* fp, const char* fmt0, __va_list ap) {
- int ret;
-
- FLOCKFILE(fp);
- ret = __vfprintf(fp, fmt0, ap);
- FUNLOCKFILE(fp);
- return (ret);
-}
-DEF_STRONG(vfprintf);
-
int __vfprintf(FILE* fp, const char* fmt0, __va_list ap) {
char* fmt; /* format string */
int ch; /* character from fmt */