From: Francesco Chemolli Date: Sat, 28 Jan 2012 16:52:32 +0000 (+0100) Subject: Changed _SQUID_MSWIN_ to _SQUID_WINDOWS_ everywhere.\nEmulated some more missing... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b308dcb9d92148fadcbdf6c2496f33efa2e4e8a;p=thirdparty%2Fsquid.git Changed _SQUID_MSWIN_ to _SQUID_WINDOWS_ everywhere.\nEmulated some more missing windows functions --- diff --git a/compat/getnameinfo.c b/compat/getnameinfo.c index 35a8b9def4..f69124f6ef 100644 --- a/compat/getnameinfo.c +++ b/compat/getnameinfo.c @@ -114,7 +114,7 @@ #include #endif -#if _SQUID_MSWIN_ +#if _SQUID_WINDOWS_ #undef IN_ADDR #include #endif diff --git a/compat/mswin.cc b/compat/mswin.cc index c507bd4b7d..5aeff1f6cc 100644 --- a/compat/mswin.cc +++ b/compat/mswin.cc @@ -39,7 +39,7 @@ /* The following code section is part of an EXPERIMENTAL native */ /* Windows NT/2000 Squid port - Compiles only on MS Visual C++ or MinGW */ -#if _SQUID_MSWIN_ || _SQUID_MINGW_ +#if _SQUID_WINDOWS_ || _SQUID_MINGW_ //#undef strerror #define sys_nerr _sys_nerr diff --git a/compat/os/mswin.h b/compat/os/mswin.h index 00198a5029..d7215b68d1 100644 --- a/compat/os/mswin.h +++ b/compat/os/mswin.h @@ -226,7 +226,7 @@ struct timezone { #include #include -#if _SQUID_MSWIN_ || _SQUID_MINGW_ +#if _SQUID_WINDOWS_ || _SQUID_MINGW_ #if HAVE_WINSOCK2_H #include #elif HAVE_WINSOCK_H @@ -234,7 +234,7 @@ struct timezone { #endif #undef IN_ADDR #include -#endif /* _SQUID_MSWIN_ || _SQUID_MINGW_ */ +#endif /* _SQUID_WINDOWS_ || _SQUID_MINGW_ */ #if (EAI_NODATA == EAI_NONAME) #undef EAI_NODATA @@ -620,10 +620,10 @@ select(int n, fd_set * r, fd_set * w, fd_set * e, struct timeval * t) #define select(n,r,w,e,t) Squid::select(n,r,w,e,t) inline ssize_t -send(int s, const void * b, size_t l, int f) +send(int s, const char * b, size_t l, int f) { ssize_t result; - if ((result = ::send(_get_osfhandle(s), (char *)b, l, f)) == SOCKET_ERROR) { + if ((result = ::send(_get_osfhandle(s), b, l, f)) == SOCKET_ERROR) { errno = WSAGetLastError(); return -1; } else @@ -681,6 +681,13 @@ socket(int f, int t, int p) } #define socket(f,t,p) Squid::socket(f,t,p) +inline int +pipe(int pipefd[2]) +{ + return _pipe(pipefd,4096,_O_BINARY); +} +using Squid::pipe; + inline int WSAAsyncSelect(int s, HWND h, unsigned int w, long e) { @@ -853,5 +860,14 @@ void syslog(int priority, const char *fmt, ...); #endif +/* prototypes */ +void WIN32_maperror(unsigned long WIN32_oserrno); +#if !HAVE_GETPAGESIZE +inline size_t +getpagesize() { + return 4096; +} +#endif + #endif /* _SQUID_WINDOWS_ */ #endif /* SQUID_OS_MSWIN_H */ diff --git a/compat/osdetect.h b/compat/osdetect.h index 71a27dd918..d5c27ac4a9 100644 --- a/compat/osdetect.h +++ b/compat/osdetect.h @@ -80,7 +80,7 @@ // gets detected and a macro defined for it. // the old name for MSVC *and* MingW (TODO: remove from use) -#define _SQUID_MSWIN_ 1 +#define _SQUID_WINDOWS_ 1 #elif defined(__APPLE__) #define _SQUID_APPLE_ 1 diff --git a/compat/types.h b/compat/types.h index 7e99e40a7b..0ae813dd8c 100644 --- a/compat/types.h +++ b/compat/types.h @@ -93,7 +93,7 @@ * "%lx" instead of "%llx" */ #ifndef PRId64 -#if _SQUID_MSWIN_ /* Windows native port using MSVCRT */ +#if _SQUID_WINDOWS_ /* Windows native port using MSVCRT */ #define PRId64 "I64d" #elif SIZEOF_INT64_T > SIZEOF_LONG #define PRId64 "lld" @@ -103,7 +103,7 @@ #endif #ifndef PRIu64 -#if _SQUID_MSWIN_ /* Windows native port using MSVCRT */ +#if _SQUID_WINDOWS_ /* Windows native port using MSVCRT */ #define PRIu64 "I64u" #elif SIZEOF_INT64_T > SIZEOF_LONG #define PRIu64 "llu" @@ -113,7 +113,7 @@ #endif #ifndef PRIX64 -#if _SQUID_MSWIN_ /* Windows native port using MSVCRT */ +#if _SQUID_WINDOWS_ /* Windows native port using MSVCRT */ #define PRIX64 "I64X" #elif SIZEOF_INT64_T > SIZEOF_LONG #define PRIX64 "llX"