mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
Rename __in and __out in headers to avoid collision with Windows APIs
* string.h: Local variables in expansion of strdupa and strndupa * sys/wait.h: Fields in anonymous union in expansion of __wait_status_to_int
This commit is contained in:
parent
74dd44c0de
commit
bf61b38d98
@ -141,16 +141,16 @@ int _EXFUN(strverscmp,(const char *, const char *));
|
||||
|
||||
#if __GNU_VISIBLE && defined(__GNUC__)
|
||||
#define strdupa(__s) \
|
||||
(__extension__ ({const char *__in = (__s); \
|
||||
size_t __len = strlen (__in) + 1; \
|
||||
char * __out = (char *) __builtin_alloca (__len); \
|
||||
(char *) memcpy (__out, __in, __len);}))
|
||||
(__extension__ ({const char *__sin = (__s); \
|
||||
size_t __len = strlen (__sin) + 1; \
|
||||
char * __sout = (char *) __builtin_alloca (__len); \
|
||||
(char *) memcpy (__sout, __sin, __len);}))
|
||||
#define strndupa(__s, __n) \
|
||||
(__extension__ ({const char *__in = (__s); \
|
||||
size_t __len = strnlen (__in, (__n)) + 1; \
|
||||
char *__out = (char *) __builtin_alloca (__len); \
|
||||
__out[__len-1] = '\0'; \
|
||||
(char *) memcpy (__out, __in, __len-1);}))
|
||||
(__extension__ ({const char *__sin = (__s); \
|
||||
size_t __len = strnlen (__sin, (__n)) + 1; \
|
||||
char *__sout = (char *) __builtin_alloca (__len); \
|
||||
__sout[__len-1] = '\0'; \
|
||||
(char *) memcpy (__sout, __sin, __len-1);}))
|
||||
#endif /* __GNU_VISIBLE && __GNUC__ */
|
||||
|
||||
/* There are two common basename variants. If you do NOT #include <libgen.h>
|
||||
|
@ -88,7 +88,7 @@ inline int __wait_status_to_int (const union wait & __status)
|
||||
#else /* !__cplusplus */
|
||||
|
||||
#define __wait_status_to_int(__status) (__extension__ \
|
||||
(((union { __typeof(__status) __in; int __out; }) { .__in = (__status) }).__out))
|
||||
(((union { __typeof(__status) __sin; int __sout; }) { .__sin = (__status) }).__sout))
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user