Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2006-01-12 01:56:05 +0300
committerDanny Smith <dannysmith@users.sourceforge.net>2006-01-12 01:56:05 +0300
commitcf8fbc710f02f2c828ee56b12f55fa1f793e3efd (patch)
tree67ed7d6ad76b11df411c57032c8d9ab31274d6fe /winsup/w32api
parent16442a4a8f04314fa33899941d0a6664c4198f65 (diff)
* include/winsock2.h (struct sockaddr_storage): Use RFC 2553
names for padding size constants.
Diffstat (limited to 'winsup/w32api')
-rw-r--r--winsup/w32api/ChangeLog5
-rw-r--r--winsup/w32api/include/winsock2.h24
2 files changed, 23 insertions, 6 deletions
diff --git a/winsup/w32api/ChangeLog b/winsup/w32api/ChangeLog
index 3430be4cc..37b913993 100644
--- a/winsup/w32api/ChangeLog
+++ b/winsup/w32api/ChangeLog
@@ -1,5 +1,10 @@
2006-01-12 Danny Smith <dannysmith@users.sourceforge.net>
+ * include/winsock2.h (struct sockaddr_storage): Use RFC 2553
+ names for padding size constants.
+
+2006-01-12 Danny Smith <dannysmith@users.sourceforge.net>
+
* include/aclapi.h (WINADVAPI): Add to prototypes.
* include/winreg.h (WINADVAPI): Likewise.
* include/winsvc.h (WINADVAPI): Likewise.
diff --git a/winsup/w32api/include/winsock2.h b/winsup/w32api/include/winsock2.h
index 2bc8689ce..d90a7a595 100644
--- a/winsup/w32api/include/winsock2.h
+++ b/winsup/w32api/include/winsock2.h
@@ -330,14 +330,26 @@ struct sockaddr {
char sa_data[14];
};
-/* Portable IPv6/IPv4 version of sockaddr.
- Uses padding to force 8 byte alignment
- and maximum size of 128 bytes */
+/* Portable IPv6/IPv4 version of sockaddr. Based on RFC 2553.
+ Pad to force 8 byte alignment and maximum size of 128 bytes. */
+
+/*
+ * Desired design of maximum size and alignment
+ */
+#define _SS_MAXSIZE 128
+#define _SS_ALIGNSIZE (sizeof (__int64))
+/*
+ * Definitions used for sockaddr_storage structure paddings design.
+ */
+#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (short))
+#define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (short) \
+ + _SS_PAD1SIZE \
+ + _SS_ALIGNSIZE))
struct sockaddr_storage {
short ss_family;
- char __ss_pad1[6]; /* pad to 8 */
- __int64 __ss_align; /* force alignment */
- char __ss_pad2[112]; /* pad to 128 */
+ char __ss_pad1[_SS_PAD1SIZE]; /* pad to 8 */
+ __int64 __ss_align; /* force alignment */
+ char __ss_pad2[_SS_PAD2SIZE]; /* pad to 128 */
};
#endif /* ! (__INSIDE_CYGWIN__ || __INSIDE_MSYS__) */