This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Provide in_port_t via <sys/types.h>
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org, newlib-cvs at sourceware dot org
- Date: 20 Apr 2016 08:51:21 -0000
- Subject: [newlib-cygwin] Provide in_port_t via <sys/types.h>
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7d22dc338d5aeb61f049776b85b2c87b94f7878d
commit 7d22dc338d5aeb61f049776b85b2c87b94f7878d
Author: Sebastian Huber <sebastian.huber@embedded-brains.de>
Date: Mon Apr 18 15:29:25 2016 +0200
Provide in_port_t via <sys/types.h>
Provide in_port_t via <sys/types.h> if __BSD_VISIBLE for BSD
compatibility.
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Diff:
---
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__