From a3e2f3c2b15053a2f9faccc62947b82f2219599f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 25 Jun 2013 22:26:20 -0400 Subject: 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. --- include/wchar.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'include/wchar.h') diff --git a/include/wchar.h b/include/wchar.h index d8738818..0f1f6d26 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -8,7 +8,7 @@ extern "C" { #include #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 *); -- cgit v1.2.1