* include/winsock2.h (struct sockaddr_storage): Use RFC 2553

names for padding size constants.
This commit is contained in:
Danny Smith 2006-01-11 22:56:05 +00:00
parent 16442a4a8f
commit cf8fbc710f
2 changed files with 23 additions and 6 deletions

View File

@ -1,3 +1,8 @@
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.

View File

@ -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__) */