------------------------------------------------------------ revno: 12621 revision-id: squid3@treenet.co.nz-20130911010254-5az9ij1b8or48lg2 parent: squid3@treenet.co.nz-20130911010132-21v4qwr3ofsrp05y committer: Amos Jeffries branch nick: 3.3 timestamp: Tue 2013-09-10 19:02:54 -0600 message: Windows: document the purpose and use of Squid namespace wrappers Also, add some missing #define's This is an iCelero project ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20130911010254-5az9ij1b8or48lg2 # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: 2441e710530b7704f0e6d7502fd2ae9bbbb2041e # timestamp: 2013-09-11 01:08:53 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20130911010132-\ # 21v4qwr3ofsrp05y # # Begin patch === modified file 'compat/os/mswin.h' --- compat/os/mswin.h 2013-09-11 01:01:32 +0000 +++ compat/os/mswin.h 2013-09-11 01:02:54 +0000 @@ -436,6 +436,18 @@ { /** \endcond */ +/* + * Each of these functions is defined in the Squid namespace so as not to + * clash with the winsock.h and winsock2.h definitions. + * It is then paired with a #define to cause these wrappers to be used by + * the main code instead of those system definitions. + * + * We do this wrapper in order to: + * - cast the parameter types in only one place, and + * - record errors in POSIX errno variable, and + * - map the FD value used by Squid to the socket handes used by Windows. + */ + inline int accept(int s, struct sockaddr * a, size_t * l) { @@ -666,6 +678,7 @@ } else return 0; } +#define WSAAsyncSelect(s,h,w,e) Squid::WSAAsyncSelect(s,h,w,e) #undef WSADuplicateSocket inline @@ -681,6 +694,7 @@ } else return 0; } +#define WSADuplicateSocket(s,n,l) Squid::WSADuplicateSocket(s,n,l) #undef WSASocket inline @@ -698,6 +712,7 @@ } else return _open_osfhandle(result, 0); } +#define WSASocket(a,t,p,i,g,f) Squid::WSASocket(a,t,p,i,g,f) } /* namespace Squid */