]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Changed _SQUID_MSWIN_ to _SQUID_WINDOWS_ everywhere.\nEmulated some more missing...
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 28 Jan 2012 16:52:32 +0000 (17:52 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 28 Jan 2012 16:52:32 +0000 (17:52 +0100)
compat/getnameinfo.c
compat/mswin.cc
compat/os/mswin.h
compat/osdetect.h
compat/types.h

index 35a8b9def4cc08197267a981a93e3bebab4e4810..f69124f6ef8f1aac8e8d6fe096d2d2ec0cc5b386 100644 (file)
 #include <inttypes.h>
 #endif
 
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 #undef IN_ADDR
 #include <ws2tcpip.h>
 #endif
index c507bd4b7d4f069ebc6ea70a55078b73792bba1b..5aeff1f6cce29d273ef33e6c008ff7109059c799 100644 (file)
@@ -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
index 00198a50298eb5d4dbc8efa6484dc5ef122c51f2..d7215b68d154d0ecd009c151a167ede581d84098 100644 (file)
@@ -226,7 +226,7 @@ struct timezone {
 
 #include <process.h>
 #include <errno.h>
-#if _SQUID_MSWIN_ || _SQUID_MINGW_
+#if _SQUID_WINDOWS_ || _SQUID_MINGW_
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
 #elif HAVE_WINSOCK_H
@@ -234,7 +234,7 @@ struct timezone {
 #endif
 #undef IN_ADDR
 #include <ws2tcpip.h>
-#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 */
index 71a27dd9189a8b173c5c309deddb447fe0a75eab..d5c27ac4a9e56d477e6ab99ab47a9bc5a21eff54 100644 (file)
@@ -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
index 7e99e40a7b0227a62d7f0662d5420d5709ac4814..0ae813dd8c8785542678e8d54058086128d0ddbe 100644 (file)
@@ -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"
 #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"
 #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"