These modifications require Windows Vista or newer. I am not sure how
early you need to define WINVER, but in my environment, mingw.h was
too late. #define FD_SETSIZE 1024 before including winsock2.h is the
most important change and will benefit any builds without making the
other modifications. Without it, select/win32_poll only handles up to
64 connections.
--- ../polipo-master/polipo.h 2015-12-07 07:15:40.000000000 -0700
+++ polipo.h 2016-01-21 22:31:39.900940000 -0700
@@ -26,6 +26,13 @@
#ifndef WIN32
#include <sys/param.h>
+#else
+#ifndef WINVER
+#define WINVER 0x0600
+#endif
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0600
+#endif
#endif
#include <limits.h>
--- ../polipo-master/mingw.h 2015-12-07 07:15:40.000000000 -0700
+++ mingw.h 2016-01-21 22:29:32.762496900 -0700
@@ -37,14 +37,6 @@
/* Unfortunately, there's no hiding it. */
#define HAVE_WINSOCK 1
-#ifndef WINVER
-#define WINVER 0x0501
-#endif
-
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501
-#endif
-
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0410
#endif
@@ -56,12 +48,13 @@
/* At time of writing, a fair bit of stuff doesn't work under Mingw.
* Hopefully they will be fixed later (especially the disk-cache).
*/
-#define NO_IPv6 1
-
-#define S_IROTH S_IREAD
/* Pull in winsock2.h for (almost) berkeley sockets. */
+#define FD_SETSIZE 1024
#include <winsock2.h>
+#ifdef HAVE_IPv6
+#include <ws2tcpip.h>
+#endif
// here we smash the errno defines so we can smash the socket
functions later to smash errno. yay!
#ifdef ENOTCONN
@@ -108,17 +102,6 @@
* are copied from linux man pages. A poll() macro is defined to
* call the version in mingw.c.
*/
-#define POLLIN 0x0001 /* There is data to read */
-#define POLLPRI 0x0002 /* There is urgent data to read */
-#define POLLOUT 0x0004 /* Writing now will not block */
-#define POLLERR 0x0008 /* Error condition */
-#define POLLHUP 0x0010 /* Hung up */
-#define POLLNVAL 0x0020 /* Invalid request: fd not open */
-struct pollfd {
- SOCKET fd; /* file descriptor */
- short events; /* requested events */
- short revents; /* returned events */
-};
#define poll(x, y, z) win32_poll(x, y, z)
/* These wrappers do nothing special except set the global errno variable if
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Polipo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/polipo-users