winsock2 header missing function prototypes

James Hawkins truiken at
Mon Sep 26 21:26:07 CDT 2005


While trying out example code from msdn covering windows sockets, I
ran into a problem with the winsock2.h header.  The example only
included winsock2.h and used the socket() function.  While compiling
with winelib, gcc complained that socket is not a function.  I looked
through winsock2.h and couldn't find the prototype.  It turns out the
prototype is in winsock.h.  I then checked to see if winsock2.h
included winsock.h, and it turns out it does, but with
__WINE_WINSOCK2__ defined.  This prevents the prototypes from being
included from winsock.h because they are protected by an if
!defined(__WINE_WINSOCK2__).  Right above this block is the note:

 * Prototypes
 * Remember to keep this section in sync with the
 * "Winsock Function Typedefs" section in winsock2.h.

I looked at the Winsock Function Typedefs from winsock2.h and they are
just a bunch of typedefs (of course).  If we can compile this program
in windows, shouldn't we be able to compile it with winelib/make too? 
Is there anything I'm doing wrong or should something be fixed in the

James Hawkins

More information about the wine-devel mailing list