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:
@@ -118,6 +118,14 @@
|
||||
# endif
|
||||
#endif /* wxUSE_UXTHEME */
|
||||
|
||||
#ifndef wxUSE_WINSOCK2
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_WINSOCK2 must be defined."
|
||||
# else
|
||||
# define wxUSE_WINSOCK2 0
|
||||
# endif
|
||||
#endif /* wxUSE_WINSOCK2 */
|
||||
|
||||
/*
|
||||
* Unfortunately we can't use compiler TLS support if the library can be used
|
||||
* inside a dynamically loaded DLL under Windows XP, as this can result in hard
|
||||
@@ -455,4 +463,14 @@
|
||||
# define wxUSE_POSTSCRIPT 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
IPv6 support requires winsock2.h, but the default of wxUSE_WINSOCK2 is 0.
|
||||
Don't require changing it explicitly and just turn it on automatically if
|
||||
wxUSE_IPV6 is on.
|
||||
*/
|
||||
#if wxUSE_IPV6 && !wxUSE_WINSOCK2
|
||||
#undef wxUSE_WINSOCK2
|
||||
#define wxUSE_WINSOCK2 1
|
||||
#endif
|
||||
|
||||
#endif /* _WX_MSW_CHKCONF_H_ */
|
||||
|
Reference in New Issue
Block a user