diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2016-08-12 03:16:52 -0500 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2016-08-12 11:43:14 -0500 |
commit | b14a1dbc8643f4f93ab31c19a1ebf338d7108baa (patch) | |
tree | 60a924540fb17bafa67b7c8654ae191b53a08c9b /newlib/libc/include/stdio.h | |
parent | 9169111acfc85729f151b5f33a30738351164f83 (diff) | |
download | cygnal-b14a1dbc8643f4f93ab31c19a1ebf338d7108baa.tar.gz cygnal-b14a1dbc8643f4f93ab31c19a1ebf338d7108baa.tar.bz2 cygnal-b14a1dbc8643f4f93ab31c19a1ebf338d7108baa.zip |
Define va_list in stdio.h and wchar.h
This typedef, along with that of FILE in wchar.h, were XSI prior to
inclusion in POSIX.1-2008.
Fixes: https://sourceware.org/ml/newlib/2016/msg00640.html
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diffstat (limited to 'newlib/libc/include/stdio.h')
-rw-r--r-- | newlib/libc/include/stdio.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index 866d8167d..097b0f665 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -35,9 +35,22 @@ #include <sys/cdefs.h> #include <stddef.h> +/* typedef only __gnuc_va_list, used throughout the header */ #define __need___va_list #include <stdarg.h> +/* typedef va_list only when required */ +#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE +#ifdef __GNUC__ +#ifndef _VA_LIST_DEFINED +typedef __gnuc_va_list va_list; +#define _VA_LIST_DEFINED +#endif +#else /* !__GNUC__ */ +#include <stdarg.h> +#endif +#endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */ + /* * <sys/reent.h> defines __FILE, _fpos_t. * They must be defined there because struct _reent needs them (and we don't |