From bf5090bcf3941d3095f7ec3434d1991d9de5d1b0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 24 Apr 2021 18:03:04 +0100 Subject: [PATCH] Enable Winsock 2 and IPv6 build options by default In addition to linking with Winsock 2, also use winsock2.h. This allows to turn on IPv6 support on by default under MSW, so turn it on under Unix too for consistency. Predefine _WINSOCK_DEPRECATED_NO_WARNINGS to avoid warnings about deprecated (but still available and very unlikely to be ever removed) Winsock 1 functions that we still use. --- configure.in | 1 - include/wx/android/setup.h | 8 ++------ include/wx/gtk/setup.h | 16 ++++++---------- include/wx/motif/setup.h | 8 ++------ include/wx/msw/setup.h | 16 ++++++---------- include/wx/msw/setup_inc.h | 8 ++++---- include/wx/msw/wrapwin.h | 6 ++++++ include/wx/osx/setup.h | 8 ++------ include/wx/setup_inc.h | 8 ++------ include/wx/univ/setup.h | 8 ++------ 10 files changed, 32 insertions(+), 55 deletions(-) diff --git a/configure.in b/configure.in index d20abdb225..f137c92fb1 100644 --- a/configure.in +++ b/configure.in @@ -343,7 +343,6 @@ DEFAULT_wxUSE_CAIRO=no dnl features disabled by default DEFAULT_wxUSE_ACCESSIBILITY=no -DEFAULT_wxUSE_IPV6=no DEFAULT_wxUSE_UNICODE_UTF8=no DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no diff --git a/include/wx/android/setup.h b/include/wx/android/setup.h index 3fd3ce552b..681db3a126 100644 --- a/include/wx/android/setup.h +++ b/include/wx/android/setup.h @@ -561,14 +561,10 @@ // Set to 1 to use ipv6 socket classes (requires wxUSE_SOCKETS) // -// Notice that currently setting this option under Windows will result in -// programs which can only run on recent OS versions (with ws2_32.dll -// installed) which is why it is disabled by default. -// // Default is 1. // -// Recommended setting: 1 if you need IPv6 support -#define wxUSE_IPV6 0 +// Recommended setting: 1. +#define wxUSE_IPV6 1 // Set to 1 to enable virtual file systems (required by wxHTML) #define wxUSE_FILESYSTEM 1 diff --git a/include/wx/gtk/setup.h b/include/wx/gtk/setup.h index 6695285e4a..8e356d3d72 100644 --- a/include/wx/gtk/setup.h +++ b/include/wx/gtk/setup.h @@ -562,14 +562,10 @@ // Set to 1 to use ipv6 socket classes (requires wxUSE_SOCKETS) // -// Notice that currently setting this option under Windows will result in -// programs which can only run on recent OS versions (with ws2_32.dll -// installed) which is why it is disabled by default. -// // Default is 1. // -// Recommended setting: 1 if you need IPv6 support -#define wxUSE_IPV6 0 +// Recommended setting: 1. +#define wxUSE_IPV6 1 // Set to 1 to enable virtual file systems (required by wxHTML) #define wxUSE_FILESYSTEM 1 @@ -1772,12 +1768,12 @@ // Recommended setting: 0, nobody uses .INI files any more #define wxUSE_INICONF 0 -// Set to 1 if you need to include over +// Set to 0 if you need to include rather than // -// Default is 0. +// Default is 1. // -// Recommended setting: 0, set to 1 automatically if wxUSE_IPV6 is 1. -#define wxUSE_WINSOCK2 0 +// Recommended setting: 1, required to be 1 if wxUSE_IPV6 is 1. +#define wxUSE_WINSOCK2 1 // ---------------------------------------------------------------------------- // Generic versions of native controls diff --git a/include/wx/motif/setup.h b/include/wx/motif/setup.h index cf4ee95016..c111d0e564 100644 --- a/include/wx/motif/setup.h +++ b/include/wx/motif/setup.h @@ -562,14 +562,10 @@ // Set to 1 to use ipv6 socket classes (requires wxUSE_SOCKETS) // -// Notice that currently setting this option under Windows will result in -// programs which can only run on recent OS versions (with ws2_32.dll -// installed) which is why it is disabled by default. -// // Default is 1. // -// Recommended setting: 1 if you need IPv6 support -#define wxUSE_IPV6 0 +// Recommended setting: 1. +#define wxUSE_IPV6 1 // Set to 1 to enable virtual file systems (required by wxHTML) #define wxUSE_FILESYSTEM 1 diff --git a/include/wx/msw/setup.h b/include/wx/msw/setup.h index 7b4494ce10..b582bbfd99 100644 --- a/include/wx/msw/setup.h +++ b/include/wx/msw/setup.h @@ -562,14 +562,10 @@ // Set to 1 to use ipv6 socket classes (requires wxUSE_SOCKETS) // -// Notice that currently setting this option under Windows will result in -// programs which can only run on recent OS versions (with ws2_32.dll -// installed) which is why it is disabled by default. -// // Default is 1. // -// Recommended setting: 1 if you need IPv6 support -#define wxUSE_IPV6 0 +// Recommended setting: 1. +#define wxUSE_IPV6 1 // Set to 1 to enable virtual file systems (required by wxHTML) #define wxUSE_FILESYSTEM 1 @@ -1772,12 +1768,12 @@ // Recommended setting: 0, nobody uses .INI files any more #define wxUSE_INICONF 0 -// Set to 1 if you need to include over +// Set to 0 if you need to include rather than // -// Default is 0. +// Default is 1. // -// Recommended setting: 0, set to 1 automatically if wxUSE_IPV6 is 1. -#define wxUSE_WINSOCK2 0 +// Recommended setting: 1, required to be 1 if wxUSE_IPV6 is 1. +#define wxUSE_WINSOCK2 1 // ---------------------------------------------------------------------------- // Generic versions of native controls diff --git a/include/wx/msw/setup_inc.h b/include/wx/msw/setup_inc.h index 480b7a9344..17ccef708b 100644 --- a/include/wx/msw/setup_inc.h +++ b/include/wx/msw/setup_inc.h @@ -166,12 +166,12 @@ // Recommended setting: 0, nobody uses .INI files any more #define wxUSE_INICONF 0 -// Set to 1 if you need to include over +// Set to 0 if you need to include rather than // -// Default is 0. +// Default is 1. // -// Recommended setting: 0, set to 1 automatically if wxUSE_IPV6 is 1. -#define wxUSE_WINSOCK2 0 +// Recommended setting: 1, required to be 1 if wxUSE_IPV6 is 1. +#define wxUSE_WINSOCK2 1 // ---------------------------------------------------------------------------- // Generic versions of native controls diff --git a/include/wx/msw/wrapwin.h b/include/wx/msw/wrapwin.h index dbb3173af2..869cd470f0 100644 --- a/include/wx/msw/wrapwin.h +++ b/include/wx/msw/wrapwin.h @@ -32,6 +32,12 @@ // 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 + // Avoid warnings about Winsock 1.x functions deprecated in Winsock 2 that + // we still use (and that will certainly remain available for the + // foreseeable future anyhow). + #ifndef _WINSOCK_DEPRECATED_NO_WARNINGS + #define _WINSOCK_DEPRECATED_NO_WARNINGS + #endif #include #endif diff --git a/include/wx/osx/setup.h b/include/wx/osx/setup.h index 5d20b4e33d..ed27db76a8 100644 --- a/include/wx/osx/setup.h +++ b/include/wx/osx/setup.h @@ -568,14 +568,10 @@ // Set to 1 to use ipv6 socket classes (requires wxUSE_SOCKETS) // -// Notice that currently setting this option under Windows will result in -// programs which can only run on recent OS versions (with ws2_32.dll -// installed) which is why it is disabled by default. -// // Default is 1. // -// Recommended setting: 1 if you need IPv6 support -#define wxUSE_IPV6 0 +// Recommended setting: 1. +#define wxUSE_IPV6 1 // Set to 1 to enable virtual file systems (required by wxHTML) #define wxUSE_FILESYSTEM 1 diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index 28c9c6d5f8..3ed8e55935 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -558,14 +558,10 @@ // Set to 1 to use ipv6 socket classes (requires wxUSE_SOCKETS) // -// Notice that currently setting this option under Windows will result in -// programs which can only run on recent OS versions (with ws2_32.dll -// installed) which is why it is disabled by default. -// // Default is 1. // -// Recommended setting: 1 if you need IPv6 support -#define wxUSE_IPV6 0 +// Recommended setting: 1. +#define wxUSE_IPV6 1 // Set to 1 to enable virtual file systems (required by wxHTML) #define wxUSE_FILESYSTEM 1 diff --git a/include/wx/univ/setup.h b/include/wx/univ/setup.h index 6757c978aa..e4cf8b201d 100644 --- a/include/wx/univ/setup.h +++ b/include/wx/univ/setup.h @@ -561,14 +561,10 @@ // Set to 1 to use ipv6 socket classes (requires wxUSE_SOCKETS) // -// Notice that currently setting this option under Windows will result in -// programs which can only run on recent OS versions (with ws2_32.dll -// installed) which is why it is disabled by default. -// // Default is 1. // -// Recommended setting: 1 if you need IPv6 support -#define wxUSE_IPV6 0 +// Recommended setting: 1. +#define wxUSE_IPV6 1 // Set to 1 to enable virtual file systems (required by wxHTML) #define wxUSE_FILESYSTEM 1