[PATCH] Define BSD u_intN_t types indiscriminately
Corinna Vinschen
vinschen@redhat.com
Thu Mar 24 10:09:00 GMT 2016
Is the below patch ok? Glibc actually always defines u_intN_t
types, while we define them only on RTMES, XMK and Cygwin.
Thanks,
Corinna
---
The u_intN_t types are BSD types but sanctioned by POSIX. They are
always defined when using Glibc headers so we follow suit.
newlib:
* libc/include/sys/types.h: Drop outdated __INTTYPES_DEFINED__
macro. Always define u_intN_t types.
cygwin:
* include/cygwin/types.h: Remove definition of u_intN_t types.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
---
newlib/libc/include/sys/types.h | 29 ++++++++++++-----------------
winsup/cygwin/include/cygwin/types.h | 17 -----------------
2 files changed, 12 insertions(+), 34 deletions(-)
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index feea7af..da25ab9 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -18,21 +18,10 @@
#ifndef _SYS_TYPES_H
#include <_ansi.h>
-# include <sys/cdefs.h>
-
-#ifndef __INTTYPES_DEFINED__
-#define __INTTYPES_DEFINED__
-
+#include <sys/cdefs.h>
#include <machine/_types.h>
-#if defined(__rtems__) || defined(__XMK__)
-/*
- * The following section is RTEMS specific and is needed to more
- * closely match the types defined in the BSD sys/types.h.
- * This is needed to let the RTEMS/BSD TCP/IP stack compile.
- */
-
-/* deprecated */
+/* BSD types, sanctioned by POSIX. */
#if ___int8_t_defined
typedef __uint8_t u_int8_t;
#endif
@@ -42,19 +31,25 @@ typedef __uint16_t u_int16_t;
#if ___int32_t_defined
typedef __uint32_t u_int32_t;
#endif
-
#if ___int64_t_defined
typedef __uint64_t u_int64_t;
+#endif
+
+#if defined(__rtems__) || defined(__XMK__)
+/*
+ * The following section is RTEMS specific and is needed to more
+ * closely match the types defined in the BSD sys/types.h.
+ * This is needed to let the RTEMS/BSD TCP/IP stack compile.
+ */
/* deprecated */
+#if ___int64_t_defined
typedef __uint64_t u_quad_t;
typedef __int64_t quad_t;
typedef quad_t * qaddr_t;
#endif
-#endif
-
-#endif /* ! __INTTYPES_DEFINED */
+#endif /* __rtems__ || __XMK__ */
#ifndef __need_inttypes
diff --git a/winsup/cygwin/include/cygwin/types.h b/winsup/cygwin/include/cygwin/types.h
index b01ae95..61a1bb6 100644
--- a/winsup/cygwin/include/cygwin/types.h
+++ b/winsup/cygwin/include/cygwin/types.h
@@ -141,23 +141,6 @@ typedef unsigned long vm_size_t;
typedef void *vm_object_t;
#endif /* __vm_object_t_defined */
-#ifndef __u_int8_t_defined
-#define __u_int8_t_defined
-typedef unsigned char u_int8_t;
-#endif
-#ifndef __u_int16_t_defined
-#define __u_int16_t_defined
-typedef __uint16_t u_int16_t;
-#endif
-#ifndef __u_int32_t_defined
-#define __u_int32_t_defined
-typedef __uint32_t u_int32_t;
-#endif
-#ifndef __u_int64_t_defined
-#define __u_int64_t_defined
-typedef __uint64_t u_int64_t;
-#endif
-
#ifndef __register_t_defined
#define __register_t_defined
typedef __int32_t register_t;
--
2.5.5
--
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/20160324/98cc6996/attachment.sig>
More information about the Newlib
mailing list