|
Boost : |
From: Gaurav.Jain_at_[hidden]
Date: 2007-02-13 01:58:32
Hi Chris,
Christopher Kohlhoff <chris <at> kohlhoff.com> writes:
> Hi Gaurav,
> Is this using 0.3.7? The line number corresponds to a comment in the
> latest version of the code.
Version of daytime_client.cpp is indeed 0.3.8.
>
> > "/1_33_1/include/boost/asio/ip/basic_endpoint.hpp", line 173.14:
> > 1540-0217 (S)
> > "ss_family" is not a member of "struct sockaddr_storage".
>
> Have a look in the system header file sys/socket.h (which is where
> sockaddr_storage should be defined) and see if there is a #define that
> determines what members sockaddr_storage contains.
>
> Cheers,
> Chris
Quite strange that struct sockaddr_storage doesn't have any member
"ss_family", instead address family is represented by "__ss_family".
------------------------------------------------------------------------
-
#if defined(COMPAT_43) && !defined(_KERNEL)
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(ushort_t)) #define
_SS_PAD2SIZE (_SS_MAXSIZE - (sizeof(ushort_t) + \
_SS_PAD1SIZE + _SS_ALIGNSIZE))
struct sockaddr_storage {
ushort_t __ss_family; /* address family */
char __ss_pad1[_SS_PAD1SIZE]; /* pad up to alignment
field */
#if defined(__64BIT__) || (defined(_ALL_SOURCE) && defined(_LONG_LONG))
int64_t __ss_align; /* field to force desired
structure */
/* storage alignment */ #else
int __ss_align[2];
#endif
char __ss_pad2[_SS_PAD2SIZE];
/* pad to achieve desired size */ };
#else
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - (sizeof(uchar_t) +
sizeof(sa_family_t))) #define _SS_PAD2SIZE (_SS_MAXSIZE -
(sizeof(sa_family_t) + \
_SS_PAD1SIZE + _SS_ALIGNSIZE))
struct sockaddr_storage {
uchar_t __ss_len; /* address length */
sa_family_t __ss_family; /* address family */
char __ss_pad1[_SS_PAD1SIZE]; /* pad up to alignment
field */
#if defined(__64BIT__) || (defined(_ALL_SOURCE) && defined(_LONG_LONG))
int64_t __ss_align; /* field to force desired
structure */
/* storage alignment */ #else
int __ss_align[2];
#endif
char __ss_pad2[_SS_PAD2SIZE];
/* pad to achieve desired size */ };
#endif /* COMPAT_43 */
------------------------------------------------------------------------
-----
socket applications can be compiled with COMPAT_43 defined. This will
make the sockaddr structure BSD 4.3 compatible.
Regards,
Gaurav
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk