[zeromq-dev] [PATCH] Fix incorrect include usage on Windows

Pieter Hintjens ph at imatix.com
Mon Jun 13 19:38:04 CEST 2011


On Mon, Jun 13, 2011 at 7:24 PM, Steven McCoy <steven.mccoy at miru.hk> wrote:

> Pulling 2.1.7 and building the following targets, I don't know if pc-mingw32
> should be the same as msys/mingw32 I didn't see it before.  This is without
> MinGW on Linux cross compiles which I normally run in HK...

Note that I removed the changes from 2.1.7.

> /usr/i686-w64-mingw32/sys-root/mingw/include/winsock2.h:15:2: error:
> #warning Please include winsock2.h before windows.h

Indeed, it should be sufficient to take the two places we include
windows.h, and stick windsock2.h before that.

The weird thing is that with your changes, this code in windows.hpp
was doing the #else part (and that's where the build errors came
from):

//  Enable winsock (not included when WIN32_LEAN_AND_MEAN is defined).
#if(_WIN32_WINNT >= 0x0400)
#include <winsock2.h>
#include <mswsock.h>
#else
#include <winsock.h>
#endif

-Pieter



More information about the zeromq-dev mailing list