This is the mail archive of the newlib@sourceware.org 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] add redefinition guards to sys/types.h


The attached patch is necessary to fix the native compile of the cross-rpcgen tool build when cross-compiling glibc.


Yaakov
Cygwin/X
2013-07-05  Yaakov Selkowitz  <yselkowitz@...>

	* libc/include/sys/types.h (u_char): Add redefinition guard.
	(u_short, u_int, u_long, daddr_t, caddr_t): Ditto.

Index: libc/include/sys/types.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/types.h,v
retrieving revision 1.39
diff -u -p -r1.39 types.h
--- libc/include/sys/types.h	6 Jul 2012 10:41:21 -0000	1.39
+++ libc/include/sys/types.h	5 Jul 2013 08:29:16 -0000
@@ -89,10 +89,22 @@ typedef	quad_t *	qaddr_t;
 
 #ifndef _BSDTYPES_DEFINED
 /* also defined in mingw/gmon.h and in w32api/winsock[2].h */
+#ifndef __u_char_defined
 typedef	unsigned char	u_char;
+#define __u_char_defined
+#endif
+#ifndef __u_short_defined
 typedef	unsigned short	u_short;
+#define __u_short_defined
+#endif
+#ifndef __u_int_defined
 typedef	unsigned int	u_int;
+#define __u_int_defined
+#endif
+#ifndef __u_long_defined
 typedef	unsigned long	u_long;
+#define __u_long_defined
+#endif
 #define _BSDTYPES_DEFINED
 #endif
 
@@ -126,8 +138,14 @@ struct itimerspec {
   struct timespec  it_value;     /* Timer expiration */
 };
 
+#ifndef __daddr_t_defined
 typedef	long	daddr_t;
+#define __daddr_t_defined
+#endif
+#ifndef __caddr_t_defined
 typedef	char *	caddr_t;
+#define __caddr_t_defined
+#endif
 
 #ifndef __CYGWIN__
 #if defined(__MS_types__) || defined(__rtems__) || \

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