The big winsock patch
fgouget at free.fr
Wed Nov 14 00:26:29 CST 2001
I removed the WS_API macros and added a couple of asynchronous
related definitions. The rest is unchanged.
On Sun, 21 Oct 2001, Francois Gouget wrote:
> This patch fixes the issues listed in bug #118:
> * winsock.h should not depend on the Unix socket headers. The Unix
> socket headers vary quite a bit and may not match what is expected by
> WineLib applications, especially wrt. cdecl/stdcall.
> * Because the Unix headers are stored in different files depending on
> the platform, #including them requires making use of config.h which is
> * The existing winsock headers were incompatible with the MSVCRT
> headers which made it pretty much impossible to use the MSVCRT headers.
> Other notes:
> * It also introduces two operating modes, quite like what was done for
> the MSVCRT: if USE_WS_PREFIX is defined then all symbols that may
> conflict with the Unix ones are prefixed with 'WS_'. In that case one
> can include both the winsock headers and the Unix headers. This is used
> in Wine. If USE_WS_PREFIX is not defined, then no symbol is prefixed.
> This is the mode that WineLib users will most likely want.
> * All that the Unix socket headers used to define is now defined
> directly in winsock.h, with the layout/names that Win32 applications
> expect. I also moved some symbols to their rightful headers, and added
> ws2tcpip.h in the process.
> * It also adds some missing symbols. I believe winsock.h should be
> complete (or pretty much so). There are still some symbols missing in
> * There is one case where winsock.h can conflict with the Unix headers.
> This is related to the select symbols (FD_SETSIZE, FD_CLR, ...). The
> problem is that these are not socket related on Unix, and thus defined
> in stdlib.h, while they are considered socket specific on Windows. So if
> you don't use the MSVCRT headers you may get incompatible definitions.
> 'winsock.h' tries hard to make sure this won't be the case but if you
> include stdlib.h before you include winsock.h, then winsock.h will
> 'invalidate' all the FD_XXX symbols so that you don't use them by
> * I also added a WINE_NOWINSOCK macro that WineLib users can define if
> they do not want windows.h to include the winsock2.h header.
> * THe new winsock headers are now compatible with both the standard
> Unix headers (with the exception noted above), and with the MSVCRt
> * dlls/winsock/Makefile.in,
> Make winsock.h and winsock2.h independent from the Unix headers
> Make them compatible with both the Unix C headers and the MSVCRT
> Ensure compatibility with the Unix headers via the USE_WS_PREFIX macro
> Add WINE_NOWINSOCK: prevents winsock.h from being included
> from windows.h when defined
> Add ws2tcpip.h, move definitions to the right header
Francois Gouget fgouget at free.fr http://fgouget.free.fr/
Hiroshima '45 - Czernobyl '86 - Windows '95
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 26558 bytes
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20011113/f5712f2b/p20011113-winsock.diff.obj
More information about the wine-patches