Cross compiling Wine with MinGW

Hans Leidekker hans at it.vu.nl
Mon Mar 1 15:10:49 CST 2004


On Sunday 29 February 2004 20:49, Juan Lang wrote:

> > Shouldn't wininet build on ws2_32 and thus compile?
> > I think it should be investigated...
>
> wininet currently depends on OpenSSL and BSD (unix)
> sockets.  I think the way OpenSSL is being used makes
> it rather hard to use ws2_32 instead, but if someone
> wants to take that on that would help.  I'm trying to
> implement SSL in secur32.dll so wininet can use this,
> but it will take me a while (it's rather large).
> Helpers welcome :)
>
> I can fix up vnb.vxd, it really should build on MinGW,
> whether or not it's useful to do so.  I'll send a
> patch shortly.

If I include winsock2.h, get rid of the sys/socket.h,
netinet/in.h and arpa/inet.h includes and additionally
link to ws2_32 it builds on MinGW as well as Wine.

> Hans, why didn't wsock32 build?  It looks like
> configure should protect you against missing headers
> and whatnot; it mostly forwards to iphlpapi and
> ws2_32.

It's missing some constants:

../../../wine/dlls/wsock32/protocol.c:144: `SOCK_STREAM' undeclared (first use 
in this function)

../../../wine/dlls/wsock32/protocol.c:155: `SOCK_DGRAM' undeclared (first use 
in this function)

These are in winsock.h but protocol.c only includes winsock2.h
When I change the include to winsock.h I get:

../../../wine/include/winsock.h:25:4: #error Please use Winsock2 in Wine

winsock2.h says:

FIXME: Still missing required Winsock 2 definitions.

MinGW and MSVC versions of winsock2.h have the defines, so
I guess we need to add them. Attached patch does so.

  -Hans

Changelog:
  add protocol type constants.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: include_winsock2_h.diff
Type: text/x-diff
Size: 885 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20040301/65d68470/include_winsock2_h.bin


More information about the wine-devel mailing list