]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed more windows emulation stuff.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 29 Jan 2012 22:30:16 +0000 (23:30 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 29 Jan 2012 22:30:16 +0000 (23:30 +0100)
Unfortunately the availability of som eAPI require targeting WinXP or later.

acinclude/os-deps.m4
compat/os/mswin.h
src/ip/Address.h
src/tools.cc
tools/purge/convert.hh

index 3c8ace52d973112ce3f7a11d63597cfda4b23087..1b4e606aae9501ec354b86c9a58d4f7fc1ad7292 100644 (file)
@@ -242,11 +242,10 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #if HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-#if HAVE_WINSOCK_H
-#include <winsock.h>
-#endif
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
+#elif HAVE_WINSOCK_H
+#include <winsock.h>
 #endif
 int main(int argc, char **argv) {
        FILE *fp = fopen("conftestval", "w");
@@ -422,11 +421,10 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
-#if HAVE_WINSOCK_H
-#include <winsock.h>
-#endif
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
+#elif HAVE_WINSOCK_H
+#include <winsock.h>
 #endif
 int main(int argc, char **argv)
 {
@@ -473,11 +471,10 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
-#if HAVE_WINSOCK_H
-#include <winsock.h>
-#endif
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
+#elif HAVE_WINSOCK_H
+#include <winsock.h>
 #endif
 int main(int argc, char **argv)
 {
@@ -524,11 +521,10 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
-#if HAVE_WINSOCK_H
-#include <winsock.h>
-#endif
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
+#elif HAVE_WINSOCK_H
+#include <winsock.h>
 #endif
 int main(int argc, char **argv)
 {
@@ -579,11 +575,10 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[
 #if HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
-#if HAVE_WINSOCK_H
-#include <winsock.h>
-#endif
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
+#elif HAVE_WINSOCK_H
+#include <winsock.h>
 #endif
 int main(int argc, char **argv)
 {
@@ -885,8 +880,7 @@ AC_DEFUN([SQUID_CHECK_RECV_ARG_TYPE],[
 #endif
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
-#endif
-#if HAVE_WINSOCK_H
+#elif HAVE_WINSOCK_H
 #include <winsock.h>
 #endif
 int main (int argc, char ** argv) {
index a3ff36daadff83bf664cfbf9853ee8905a51766c..3a94b307be58f3626372cdc0405e1103c3dcd980 100644 (file)
 
 #if _SQUID_WINDOWS_
 
+/* we target Windows XP and later - some API are missing otherwise */
+#if _SQUID_MINGW_
+#if WINVER < 0x0501
+#undef WINVER
+#define WINVER 0x0501
+#undef _WIN32_WINNT
+#define _WIN32_WINNT WINVER
+#endif
+#endif /* _SQUID_MINGW_ */
+
 #if HAVE_FCNTL_H
 #include <fcntl.h>
 #endif /* HAVE_FCNTL_H */
@@ -794,14 +804,46 @@ SQUIDCEXTERN int statfs(const char *, struct statfs *);
 SQUIDCEXTERN struct passwd * getpwnam(char *unused);
 SQUIDCEXTERN struct group * getgrnam(char *unused);
 
-#define geteuid(X)  static_cast<uid_t>(100)
-#define seteuid(X)  (void)0
-#define getuid(X)   static_cast<uid_t>(100)
-#define setuid(X)   (void)0
-#define getegid(X)  static_cast<gid_t>(100)
-#define setegid(X)  (void)0
-#define getgid(X)   static_cast<gid_t>(100)
-#define setgid(X)   (void)0
+static inline uid_t
+geteuid(void)
+{
+       return 100;
+}
+static inline int
+seteuid (uid_t euid)
+{
+       return 0;
+}
+static inline uid_t
+getuid(void)
+{
+       return 100;
+}
+static inline int
+setuid (uid_t uid)
+{
+       return 0;
+}
+static inline gid_t
+getegid(void)
+{
+       return 100;
+}
+static inline int
+setegid (gid_t egid)
+{
+       return 0;
+}
+static inline int
+getgid(void)
+{
+       return 100;
+}
+static inline int
+setgid (gid_t gid)
+{
+       return 0;
+}
 
 /* for some reason autoconf misdetects getpagesize.. */
 #if HAVE_GETPAGESIZE
index eb4f3eb9cc0b64e87dc3105e0432a34bcb6504ab..fdffd540025bdbef75e27d2fd3786cafd988ae1f 100644 (file)
@@ -48,8 +48,7 @@
 #endif
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
-#endif
-#if HAVE_WINSOCK_H
+#elif HAVE_WINSOCK_H
 #include <winsock.h>
 #endif
 #if HAVE_NETDB_H
index 134116781023de4f59abcde3b367d8cc913215e7..cad86adf52f1e22ad8aaaea1854f6d352cca998d 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "squid-old.h"
 #include "base/Subscription.h"
+#include "compat/initgroups.h"
 #include "fde.h"
 #include "ICP.h"
 #include "ip/Intercept.h"
index 05e59b3783f0e445a6e84661838ebf1046906b7c..7725a88376f589452cdc06c19779ff764512eb58 100644 (file)
@@ -60,8 +60,7 @@ typedef char bool;
 #endif
 #if HAVE_WINSOCK2_H
 #include <winsock2.h>
-#endif
-#if HAVE_WINSOCK_H
+#elif HAVE_WINSOCK_H
 #include <winsock.h>
 #endif