This is the mail archive of the mailing list for the newlib project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v3 23/24] Feature test macros overhaul: sys/types.h

The u_int/u_char/etc. BSD types are needed by Cygwin's netinet/*.h
headers, so they always need to be available.

Signed-off-by: Yaakov Selkowitz <>
 newlib/libc/include/sys/types.h | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index c9f0fc7..c09866b 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -84,13 +84,14 @@ typedef	quad_t *	qaddr_t;
 #define _ST_INT32
 #include <sys/select.h>
 #  define	physadr		physadr_t
 #  define	quad		quad_t
+/* These types are required by netinet/*.h on Cygwin */
+#if __BSD_VISIBLE || defined(__CYGWIN__)
 /* also defined in mingw/gmon.h and in w32api/winsock[2].h */
 #ifndef __u_char_defined
@@ -111,11 +112,13 @@ typedef	unsigned long	u_long;
+#endif	/*__BSD_VISIBLE || __CYGWIN__ */
 typedef	unsigned short	ushort;		/* System V compatibility */
 typedef	unsigned int	uint;		/* System V compatibility */
 typedef	unsigned long	ulong;		/* System V compatibility */
-# endif	/*__BSD_VISIBLE */
 #ifndef __clock_t_defined
 typedef _CLOCK_T_ clock_t;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]