#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");
#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)
{
#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)
{
#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)
{
#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)
{
#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) {
#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 */
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
#include "squid-old.h"
#include "base/Subscription.h"
+#include "compat/initgroups.h"
#include "fde.h"
#include "ICP.h"
#include "ip/Intercept.h"