Add wxUSE_WINSOCK2 wxMSW option to include winsock2.h

Including <winsock.h> and <winsock2.h> is incompatible and if the
application wants to use the latter, it may be convenient to define
wxUSE_WINSOCK2 when building wxWidgets instead of having to work around
winsock.h implicit inclusion from include/wx/msw/wrapwin.h.

Closes https://github.com/wxWidgets/wxWidgets/pull/1122
This commit is contained in:
Tomay
2019-01-10 05:07:39 +01:00
committed by Vadim Zeitlin
parent eaee931011
commit 8deb2cf0bb
11 changed files with 65 additions and 3 deletions

View File

@@ -28,9 +28,10 @@
#endif // NOMINMAX
// For IPv6 support, we must include winsock2.h before winsock.h, and
// windows.h include winsock.h so do it before including it
#if wxUSE_IPV6
// When the application wants to use <winsock2.h> (this is required for IPv6
// support, for example), we must include it before winsock.h, and as windows.h
// includes winsock.h, we have to do it before including it.
#if wxUSE_WINSOCK2
#include <winsock2.h>
#endif