------------------------------------------------------------ revno: 13587 revision-id: squid3@treenet.co.nz-20140915005305-9vomnjc1j1wpk6xa parent: squid3@treenet.co.nz-20140914141501-7bw2i659hm7cupjj committer: Amos Jeffries branch nick: trunk timestamp: Sun 2014-09-14 17:53:05 -0700 message: Windows: fix mapping between POSIX and Windows socket types MinGW at least still defines several socket structure fields with size_t instead of socklen_t. In order to maintain the POSIX API definition in appearance we need to cast these types to their POSIX variant regardless of whether size_t or socklen_t is used. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140915005305-9vomnjc1j1wpk6xa # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: e428e125e5f8db3d2398ad39c259e6f061c26ba3 # timestamp: 2014-09-15 10:53:23 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20140914141501-\ # 7bw2i659hm7cupjj # # Begin patch === modified file 'compat/os/mswindows.h' --- compat/os/mswindows.h 2014-09-02 01:08:58 +0000 +++ compat/os/mswindows.h 2014-09-15 00:53:05 +0000 @@ -527,7 +527,7 @@ } else return _open_osfhandle(result, 0); } -#define accept(s,a,l) Squid::accept(s,a,l) +#define accept(s,a,l) Squid::accept(s,a,reinterpret_cast(l)) inline int bind(int s, const struct sockaddr * n, socklen_t l) @@ -591,7 +591,7 @@ } else return 0; } -#define getsockname(s,a,l) Squid::getsockname(s,a,l) +#define getsockname(s,a,l) Squid::getsockname(s,a,reinterpret_cast(l)) inline int gethostname(char * n, size_t l) @@ -674,7 +674,7 @@ } else return result; } -#define recvfrom(s,b,l,f,r,n) Squid::recvfrom(s,b,l,f,r,n) +#define recvfrom(s,b,l,f,r,n) Squid::recvfrom(s,b,l,f,r,reinterpret_cast(n)) inline int select(int n, fd_set * r, fd_set * w, fd_set * e, struct timeval * t) @@ -698,7 +698,7 @@ } else return result; } -#define send(s,b,l,f) Squid::send(s,b,l,f) +#define send(s,b,l,f) Squid::send(s,reinterpret_cast(b),l,f) inline ssize_t sendto(int s, const void * b, size_t l, int f, const struct sockaddr * t, socklen_t tl)