respect iso c namespace in stdio.h and wchar.h regarding va_list

despite declaring functions that take arguments of type va_list, these
headers are not permitted by the c standard to expose the definition
of va_list, so an alias for the type must be used. the name
__isoc_va_list was chosen to convey that the purpose of this alternate
name is for iso c conformance, and to avoid the multitude of names
which gcc mangles with its hideous "fixincludes" monstrosity, leading
to serious header breakage if these "fixes" are run.
This commit is contained in:
Rich Felker 2013-06-25 22:26:20 -04:00
commit a3e2f3c2b1
8 changed files with 26 additions and 17 deletions

View file

@ -8,7 +8,7 @@ extern "C" {
#include <features.h>
#define __NEED_FILE
#define __NEED_va_list
#define __NEED___isoc_va_list
#define __NEED_size_t
#define __NEED_wchar_t
#define __NEED_wint_t
@ -16,6 +16,7 @@ extern "C" {
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
#define __NEED_locale_t
#define __NEED_va_list
#endif
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
@ -105,17 +106,17 @@ int wprintf (const wchar_t *__restrict, ...);
int fwprintf (FILE *__restrict, const wchar_t *__restrict, ...);
int swprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, ...);
int vwprintf (const wchar_t *__restrict, va_list);
int vfwprintf (FILE *__restrict, const wchar_t *__restrict, va_list);
int vswprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, va_list);
int vwprintf (const wchar_t *__restrict, __isoc_va_list);
int vfwprintf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list);
int vswprintf (wchar_t *__restrict, size_t, const wchar_t *__restrict, __isoc_va_list);
int wscanf (const wchar_t *__restrict, ...);
int fwscanf (FILE *__restrict, const wchar_t *__restrict, ...);
int swscanf (const wchar_t *__restrict, const wchar_t *__restrict, ...);
int vwscanf (const wchar_t *__restrict, va_list);
int vfwscanf (FILE *__restrict, const wchar_t *__restrict, va_list);
int vswscanf (const wchar_t *__restrict, const wchar_t *__restrict, va_list);
int vwscanf (const wchar_t *__restrict, __isoc_va_list);
int vfwscanf (FILE *__restrict, const wchar_t *__restrict, __isoc_va_list);
int vswscanf (const wchar_t *__restrict, const wchar_t *__restrict, __isoc_va_list);
wint_t fgetwc (FILE *);
wint_t getwc (FILE *);