[PATCH 15/18] Add __va_list to <sys/_types.h>
Corinna Vinschen
vinschen@redhat.com
Fri Apr 15 11:23:00 GMT 2016
On Apr 15 12:52, Sebastian Huber wrote:
>
>
> On 15/04/16 12:11, Corinna Vinschen wrote:
> >On Apr 14 13:54, Sebastian Huber wrote:
> >>>Add __va_list to <sys/_types.h> for BSD compatibility. In FreeBSD this
> >>>typedef is provided by the various architecture-specific
> >>><machine/_types.h> in a copy and paste manner.
> >>>
> >>>Signed-off-by: Sebastian Huber<sebastian.huber@embedded-brains.de>
> >>>---
> >>> newlib/libc/include/sys/_types.h | 6 ++++++
> >>> 1 file changed, 6 insertions(+)
> >>>
> >>>diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
> >>>index 03e1ba3..73f1de6 100644
> >>>--- a/newlib/libc/include/sys/_types.h
> >>>+++ b/newlib/libc/include/sys/_types.h
> >>>@@ -177,4 +177,10 @@ typedef unsigned short __nlink_t;
> >>> typedef long __suseconds_t; /* microseconds (signed) */
> >>> typedef unsigned long __useconds_t; /* microseconds (unsigned) */
> >>> >+#ifdef __GNUCLIKE_BUILTIN_VARARGS
> >>>+typedef __builtin_va_list __va_list;
> >>>+#else
> >>>+typedef char * __va_list;
> >>>+#endif /* __GNUCLIKE_BUILTIN_VARARGS */
> >>>+
> >>> #endif /* _SYS__TYPES_H */
> >>>-- >1.8.4.5
> >Is that supposed to replace __VALIST in stdio.h>
>
> No, it is used to use, e.g. <syslog.h> from FreeBSD (see tail of file):
>
> https://svnweb.freebsd.org/base/head/sys/sys/syslog.h?revision=249311&view=markup
I'm asking because FreeBSD uses __va_list throughout stdio.h rather than
using this weird __VALIST. I think we should do the same (not in this
patch series, but again, something to keep in mind).
I also just noticed that stdio.h always includes stddef.h to fetch the
definition of va_list. This seems wrong in terms of the feature test
macros. FreeBSD only defines va_list (as __va_list) if
__POSIX_VISIBLE >= 200112 || __XSI_VISIBLE.
Yaakov, is that something you have on your FTM radar?
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20160415/0b84b95d/attachment.sig>
More information about the Newlib
mailing list