This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH 05/22] Provide in_port_t via <sys/types.h>
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: newlib at sourceware dot org
- Cc: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Date: Mon, 18 Apr 2016 15:29:25 +0200
- Subject: [PATCH 05/22] Provide in_port_t via <sys/types.h>
- Authentication-results: sourceware.org; auth=none
- References: <1460986182-11952-1-git-send-email-sebastian dot huber at embedded-brains dot de>
Provide in_port_t via <sys/types.h> if __BSD_VISIBLE for BSD
compatibility.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
newlib/libc/include/sys/types.h | 5 +++++
winsup/cygwin/include/cygwin/in.h | 5 ++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 1d2d54c..dbd6f2b 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -71,6 +71,11 @@ typedef quad_t * qaddr_t;
typedef __uint32_t in_addr_t; /* base type for internet address */
#define _IN_ADDR_T_DECLARED
#endif
+
+#ifndef _IN_PORT_T_DECLARED
+typedef __uint16_t in_port_t;
+#define _IN_PORT_T_DECLARED
+#endif
#endif /* __BSD_VISIBLE */
#if __MISC_VISIBLE
diff --git a/winsup/cygwin/include/cygwin/in.h b/winsup/cygwin/include/cygwin/in.h
index 3242d68..9d7331d 100644
--- a/winsup/cygwin/include/cygwin/in.h
+++ b/winsup/cygwin/include/cygwin/in.h
@@ -25,7 +25,10 @@ typedef __uint32_t in_addr_t;
#define _IN_ADDR_T_DECLARED
#endif
-typedef uint16_t in_port_t;
+#ifndef _IN_PORT_T_DECLARED
+typedef __uint16_t in_port_t;
+#define _IN_PORT_T_DECLARED
+#endif
#ifndef __INSIDE_CYGWIN_NET__
--
1.8.4.5