--------------------- PatchSet 658 Date: 2003/03/13 21:01:16 Author: serassio Branch: nt Tag: (none) Log: C++ Windows fixes Members: port/win32/include/autoconf.h:1.2.18.1->1.2.18.2 port/win32/include/squid-mswin.h:1.3.18.1->1.3.18.2 src/protos.h:1.19.2.6->1.19.2.7 src/squid.h:1.7.2.3->1.7.2.4 Index: squid3/port/win32/include/autoconf.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/port/win32/include/Attic/autoconf.h,v retrieving revision 1.2.18.1 retrieving revision 1.2.18.2 diff -u -r1.2.18.1 -r1.2.18.2 --- squid3/port/win32/include/autoconf.h 25 Feb 2003 02:48:45 -0000 1.2.18.1 +++ squid3/port/win32/include/autoconf.h 13 Mar 2003 21:02:06 -0000 1.2.18.2 @@ -321,6 +321,9 @@ /* off_t is defined by the system headers */ #define HAVE_OFF_T 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_OPENSSL_ENGINE_H */ + /* Define to 1 if you have the header file. */ #define HAVE_OPENSSL_ERR_H 1 @@ -387,6 +390,9 @@ /* Define to 1 if you have the `rint' function. */ /* #undef HAVE_RINT */ +/* Define to 1 if you have the `sbrk' function. */ +/* #undef HAVE_SBRK */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_SCHED_H */ @@ -394,7 +400,6 @@ #define HAVE_SELECT 1 /* Define to 1 if you have the `seteuid' function. */ -/* #undef HAVE_SETEUID */ #define HAVE_SETEUID 1 /* Define to 1 if you have the `setgroups' function. */ @@ -441,7 +446,6 @@ /* #undef HAVE_SRANDOM */ /* ssize_t is defined by the system headers */ -/* #undef HAVE_SSIZE_T */ #define HAVE_SSIZE_T 1 /* Define to 1 if you have the `statfs' function. */ @@ -611,7 +615,7 @@ /* By default (for now anyway) Squid includes options which allows the cache administrator to violate the HTTP protocol specification in terms of cache behaviour. Setting this to '0' will disable such code. */ -/* #undef HTTP_VIOLATIONS */ +#define HTTP_VIOLATIONS 1 /* Enable support for Transparent Proxy on systems using IP-Filter address redirection. This provides "masquerading" support for non Linux system. */ @@ -812,5 +816,11 @@ /* Enable support for the X-Accelerator-Vary HTTP header */ /* #undef X_ACCELERATOR_VARY */ +/* Keyword used by squid for inlining methods */ +#define _SQUID_INLINE_ inline + +/* Include inline methods into header file */ +#define _USE_INLINE_ + /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ Index: squid3/port/win32/include/squid-mswin.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/port/win32/include/Attic/squid-mswin.h,v retrieving revision 1.3.18.1 retrieving revision 1.3.18.2 diff -u -r1.3.18.1 -r1.3.18.2 --- squid3/port/win32/include/squid-mswin.h 25 Feb 2003 02:48:45 -0000 1.3.18.1 +++ squid3/port/win32/include/squid-mswin.h 13 Mar 2003 21:02:08 -0000 1.3.18.2 @@ -1,5 +1,5 @@ /* - * $Id: squid-mswin.h,v 1.3.18.1 2003/02/25 02:48:45 hno Exp $ + * $Id: squid-mswin.h,v 1.3.18.2 2003/03/13 21:02:08 serassio Exp $ * * AUTHOR: Guido Serassio & Andrey Shorin * @@ -31,6 +31,7 @@ * */ +#define ACL WindowsACL #if defined(_MSC_VER) /* Microsoft C Compiler ONLY */ typedef char int8_t; @@ -328,8 +329,10 @@ return _write(fd, buf, siz); } +namespace Squid { + inline -int squid_accept(int s, struct sockaddr FAR * a, int FAR * l) +int accept(int s, struct sockaddr FAR * a, int FAR * l) { SOCKET result; if ((result = ::accept(_get_osfhandle(s), a, l)) == INVALID_SOCKET) { @@ -340,10 +343,9 @@ else return _open_osfhandle(result, 0); } -#define accept(s,a,l) squid_accept(s,a,l) inline -int squid_bind(int s, struct sockaddr * n, int l) +int bind(int s, struct sockaddr * n, int l) { if (::bind(_get_osfhandle(s),n,l) == SOCKET_ERROR) { errno = WSAGetLastError(); @@ -352,10 +354,9 @@ else return 0; } -#define bind(s,n,l) squid_bind(s,n,l) inline -int squid_connect(int s, const struct sockaddr * n, int l) +int connect(int s, const struct sockaddr * n, int l) { if (::connect(_get_osfhandle(s),n,l) == SOCKET_ERROR) { if (WSAEMFILE == (errno = WSAGetLastError())) @@ -365,40 +366,36 @@ else return 0; } -#define connect(s,n,l) squid_connect(s,n,l) inline -HOSTENT FAR * squid_gethostbyname (const char *n) +HOSTENT FAR * gethostbyname (const char *n) { HOSTENT FAR * result; if ((result = ::gethostbyname(n)) == NULL) errno = WSAGetLastError(); return result; } -#define gethostbyname(n) squid_gethostbyname(n) inline -SERVENT FAR* squid_getservbyname (const char * n, const char * p) +SERVENT FAR* getservbyname (const char * n, const char * p) { SERVENT FAR * result; if ((result = ::getservbyname(n, p)) == NULL) errno = WSAGetLastError(); return result; } -#define getservbyname(n,p) squid_getservbyname(n,p) inline -HOSTENT FAR * squid_gethostbyaddr(const char * a, int l, int t) +HOSTENT FAR * gethostbyaddr(const char * a, int l, int t) { HOSTENT FAR * result; if ((result = ::gethostbyaddr(a, l, t)) == NULL) errno = WSAGetLastError(); return result; } -#define gethostbyaddr(a,l,t) squid_gethostbyaddr(a,l,t) inline -int squid_getsockname(int s, struct sockaddr * n, int * l) +int getsockname(int s, struct sockaddr * n, int * l) { if ((::getsockname(_get_osfhandle(s), n, l)) == SOCKET_ERROR) { errno = WSAGetLastError(); @@ -407,10 +404,9 @@ else return 0; } -#define getsockname(s,n,l) squid_getsockname(s,n,l) inline -int squid_gethostname(char * n, size_t l) +int gethostname(char * n, size_t l) { if ((::gethostname(n, l)) == SOCKET_ERROR) { errno = WSAGetLastError(); @@ -419,10 +415,9 @@ else return 0; } -#define gethostname(n,l) squid_gethostname(n,l) inline -int squid_getsockopt(int s, int l, int o, void * v, int * n) +int getsockopt(int s, int l, int o, void * v, int * n) { Sleep(1); if ((::getsockopt(_get_osfhandle(s), l, o,(char *) v, n)) == SOCKET_ERROR) { @@ -432,7 +427,6 @@ else return 0; } -#define getsockopt(s,l,o,v,n) squid_getsockopt(s,l,o,v,n) /* Simple ioctl() emulation */ inline @@ -447,7 +441,7 @@ } inline -int squid_ioctlsocket(int s, long c, u_long FAR * a) +int ioctlsocket(int s, long c, u_long FAR * a) { if ((::ioctlsocket(_get_osfhandle(s), c, a)) == SOCKET_ERROR) { errno = WSAGetLastError(); @@ -456,10 +450,9 @@ else return 0; } -#define ioctlsocket(s,c,a) squid_ioctlsocket(s,c,a) inline -int squid_listen(int s, int b) +int listen(int s, int b) { if (::listen(_get_osfhandle(s), b) == SOCKET_ERROR) { if (WSAEMFILE == (errno = WSAGetLastError())) @@ -469,10 +462,9 @@ else return 0; } -#define listen(s,b) squid_listen(s,b) inline -int squid_recv(int s, void * b, size_t l, int f) +int recv(int s, void * b, size_t l, int f) { int result; if ((result = ::recv(_get_osfhandle(s), (char *)b, l, f)) == SOCKET_ERROR) { @@ -482,10 +474,9 @@ else return result; } -#define recv(s,b,l,f) squid_recv(s,b,l,f) inline -int squid_recvfrom(int s, void * b, size_t l, int f, struct sockaddr * fr, int FAR * fl) +int recvfrom(int s, void * b, size_t l, int f, struct sockaddr * fr, int FAR * fl) { int result; if ((result = ::recvfrom(_get_osfhandle(s), (char *)b, l, f, fr, fl)) == SOCKET_ERROR) { @@ -495,10 +486,9 @@ else return result; } -#define recvfrom(s,b,l,f,fr,fl) squid_recvfrom(s,b,l,f,fr,fl) inline -int squid_select(int n, fd_set * r, fd_set * w, fd_set * e, struct timeval * t) +int select(int n, fd_set * r, fd_set * w, fd_set * e, struct timeval * t) { int result; if ((result = ::select(n,r,w,e,t)) == SOCKET_ERROR) { @@ -508,10 +498,9 @@ else return result; } -#define select(n,r,w,e,t) squid_select(n,r,w,e,t) inline -int squid_send(int s, const void * b, size_t l, int f) +int send(int s, const void * b, size_t l, int f) { int result; if ((result = ::send(_get_osfhandle(s), (char *)b, l, f)) == SOCKET_ERROR) { @@ -521,10 +510,9 @@ else return result; } -#define send(s,b,l,f) squid_send(s,b,l,f) inline -int squid_sendto(int s, const void * b, size_t l, int f, const struct sockaddr * t, int tl) +int sendto(int s, const void * b, size_t l, int f, const struct sockaddr * t, int tl) { int result; if ((result = ::sendto(_get_osfhandle(s), (char *)b, l, f, t, tl)) == SOCKET_ERROR) { @@ -534,10 +522,9 @@ else return result; } -#define sendto(s,b,l,f,t,tl) squid_sendto(s,b,l,f,t,tl) inline -int squid_setsockopt(int s, int l, int o, const void * v, int n) +int setsockopt(int s, int l, int o, const void * v, int n) { if (::setsockopt(_get_osfhandle(s), l, o, (const char *)v, n) == SOCKET_ERROR) { errno = WSAGetLastError(); @@ -546,10 +533,9 @@ else return 0; } -#define setsockopt(s,l,o,v,n) squid_setsockopt(s,l,o,v,n) inline -int squid_shutdown(int s, int h) +int shutdown(int s, int h) { if (::shutdown(_get_osfhandle(s),h) == SOCKET_ERROR) { errno = WSAGetLastError(); @@ -558,10 +544,9 @@ else return 0; } -#define shutdown(s,h) squid_shutdown(s,h) inline -int squid_socket(int f, int t, int p) +int socket(int f, int t, int p) { SOCKET result; if ((result = ::socket(f, t, p)) == INVALID_SOCKET) { @@ -572,10 +557,9 @@ else return _open_osfhandle(result, 0); } -#define socket(f,t,p) squid_socket(f,t,p) inline -int squid_WSAAsyncSelect(int s, HWND h, unsigned int w, long e) +int WSAAsyncSelect(int s, HWND h, unsigned int w, long e) { if (::WSAAsyncSelect(_get_osfhandle(s), h, w, e) == SOCKET_ERROR) { errno = WSAGetLastError(); @@ -584,10 +568,9 @@ else return 0; } -#define WSAAsyncSelect(s,h,w,e) squid_WSAAsyncSelect(s,h,w,e) inline -int squid_WSADuplicateSocket(int s, DWORD n, LPWSAPROTOCOL_INFO l) +int WSADuplicateSocket(int s, DWORD n, LPWSAPROTOCOL_INFO l) { if (::WSADuplicateSocket(_get_osfhandle(s), n, l) == SOCKET_ERROR) { errno = WSAGetLastError(); @@ -596,11 +579,9 @@ else return 0; } -#undef WSADuplicateSocket -#define WSADuplicateSocket(s,n,l) squid_WSADuplicateSocket(s,n,l) inline -int squid_WSASocket(int a, int t, int p, LPWSAPROTOCOL_INFO i, GROUP g, DWORD f) +int WSASocket(int a, int t, int p, LPWSAPROTOCOL_INFO i, GROUP g, DWORD f) { SOCKET result; if ((result = ::WSASocket(a, t, p, i, g, f)) == INVALID_SOCKET) { @@ -611,8 +592,8 @@ else return _open_osfhandle(result, 0); } -#undef WSASocket -#define WSASocket(a,t,p,i,g,f) squid_WSASocket(a,t,p,i,g,f) + +} /* namespace Squid */ #else /* #ifdef __cplusplus */ #define connect(s,n,l) \ @@ -661,3 +642,4 @@ long ru_nvcsw; /* voluntary context switches */ long ru_nivcsw; /* involuntary context switches */ }; +#undef ACL Index: squid3/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/protos.h,v retrieving revision 1.19.2.6 retrieving revision 1.19.2.7 diff -u -r1.19.2.6 -r1.19.2.7 --- squid3/src/protos.h 11 Mar 2003 08:26:57 -0000 1.19.2.6 +++ squid3/src/protos.h 13 Mar 2003 21:01:16 -0000 1.19.2.7 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.19.2.6 2003/03/11 08:26:57 serassio Exp $ + * $Id: protos.h,v 1.19.2.7 2003/03/13 21:01:16 serassio Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -749,8 +749,8 @@ /* store_io.c */ #include "StoreIOState.h" -SQUIDCEXTERN StoreIOState::Pointer storeCreate(StoreEntry *, STFNCB *, STIOCB *, void *); -SQUIDCEXTERN StoreIOState::Pointer storeOpen(StoreEntry *, STFNCB *, STIOCB *, void *); +extern StoreIOState::Pointer storeCreate(StoreEntry *, STFNCB *, STIOCB *, void *); +extern StoreIOState::Pointer storeOpen(StoreEntry *, STFNCB *, STIOCB *, void *); SQUIDCEXTERN void storeClose(StoreIOState::Pointer); SQUIDCEXTERN void storeRead(StoreIOState::Pointer, char *, size_t, off_t, STRCB *, void *); SQUIDCEXTERN void storeIOWrite(StoreIOState::Pointer, char const *, size_t, off_t, FREE *); Index: squid3/src/squid.h =================================================================== RCS file: /cvsroot/squid-sf//squid3/src/squid.h,v retrieving revision 1.7.2.3 retrieving revision 1.7.2.4 diff -u -r1.7.2.3 -r1.7.2.4 --- squid3/src/squid.h 11 Mar 2003 08:26:57 -0000 1.7.2.3 +++ squid3/src/squid.h 13 Mar 2003 21:01:20 -0000 1.7.2.4 @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.7.2.3 2003/03/11 08:26:57 serassio Exp $ + * $Id: squid.h,v 1.7.2.4 2003/03/13 21:01:20 serassio Exp $ * * AUTHOR: Duane Wessels * @@ -37,6 +37,8 @@ #include "config.h" +using namespace Squid; + #if PURIFY #define assert(EX) ((void)0) #elif defined(NODEBUG) @@ -368,6 +370,7 @@ template inline A const & +#ifndef min min(A const & lhs, A const & rhs) { if (rhs < lhs) @@ -375,8 +378,10 @@ return lhs; } +#endif #define XMIN(x,y) (min (x,y)) +#ifndef max template inline A const & max(A const & lhs, A const & rhs) @@ -386,6 +391,7 @@ return lhs; } +#endif #define XMAX(a,b) (max (a,b))