Remove wxUSE_STL which is not really used any longer

wxString is always based on std::[w]string since 2c0c727f49 (Remove wx
own wxStringImpl implementation, 2022-11-16) and all containers use
standard containers by default too now -- and there is a separate
wxUSE_STD_CONTAINERS for this anyhow.

The only remaining use of wxUSE_STL was as the default value for
wxUSE_STD_STRING_CONV_IN_WXSTRING option, but it's not really needed
for this neither, and this option can just be set to 0 by default.

Also add wxUSE_CHAR_CONV_IN_WXSTRING which can now be set to 0 too to
disable all unwanted implicit conversions (even "safe" ones, to wide
strings, in addition to the unsafe ones to narrow strings that could be
already disabled with wxUSE_UNSAFE_WXSTRING_CONV) to allow people who
don't want to have any implicit conversions at all to do it.

Keep --enable-stl configure option for compatibility, but warn if it is
used to tell people that it is not needed any longer.
This commit is contained in:
Vadim Zeitlin 2023-04-15 15:42:10 +01:00
parent d65eed50fa
commit 35c35c235e
22 changed files with 315 additions and 248 deletions

43
configure vendored
View file

@ -1122,6 +1122,7 @@ with_cxx
enable_stl
enable_std_containers
enable_std_iostreams
enable_char_conv_in_wxstring
enable_std_string_conv_in_wxstring
enable_unsafe_conv_in_wxstring
enable_utf8
@ -2085,9 +2086,10 @@ Optional Features:
--enable-debug_gdb create code with extra GDB debugging information
--disable-shared create static library instead of shared
--enable-cxx11 obsolete option doing nothing
--enable-stl use standard C++ classes for everything
--enable-stl obsolete option doing nothing
--disable-std_containers disable use of standard C++ container classes
--disable-std_iostreams disable use of standard C++ stream classes
--disable-char_conv_in_wxstring disable implicit conversion to const wchar_t/char* in wxString
--enable-std_string_conv_in_wxstring provide implicit conversion to std::string in wxString
--disable-unsafe_conv_in_wxstring disable unsafe implicit conversions in wxString
--enable-utf8 use UTF-8 representation for strings
@ -5635,6 +5637,35 @@ fi
eval "$wx_cv_use_std_iostreams"
enablestring=disable
defaultval=
if test -z "$defaultval"; then
if test x"$enablestring" = xdisable; then
defaultval=yes
else
defaultval=no
fi
fi
# Check whether --enable-char_conv_in_wxstring was given.
if test "${enable_char_conv_in_wxstring+set}" = set; then :
enableval=$enable_char_conv_in_wxstring;
if test "$enableval" = yes; then
wx_cv_use_char_conv_in_wxstring='wxUSE_CHAR_CONV_IN_WXSTRING=yes'
else
wx_cv_use_char_conv_in_wxstring='wxUSE_CHAR_CONV_IN_WXSTRING=no'
fi
else
wx_cv_use_char_conv_in_wxstring='wxUSE_CHAR_CONV_IN_WXSTRING=${'DEFAULT_wxUSE_CHAR_CONV_IN_WXSTRING":-$defaultval}"
fi
eval "$wx_cv_use_char_conv_in_wxstring"
enablestring=
defaultval=
if test -z "$defaultval"; then
@ -36116,8 +36147,8 @@ fi
if test "$wxUSE_STL" = "yes"; then
$as_echo "#define wxUSE_STL 1" >>confdefs.h
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --enable-stl option is not needed any more and can be simply removed" >&5
$as_echo "$as_me: WARNING: --enable-stl option is not needed any more and can be simply removed" >&2;}
fi
if test "$wxUSE_EXTENDED_RTTI" = "yes"; then
@ -37433,6 +37464,11 @@ if test "$wxUSE_STD_IOSTREAM" = "yes"; then
fi
if test "$wxUSE_CHAR_CONV_IN_WXSTRING" = "yes"; then
$as_echo "#define wxUSE_CHAR_CONV_IN_WXSTRING 1" >>confdefs.h
fi
if test "$wxUSE_STD_STRING_CONV_IN_WXSTRING" = "yes"; then
$as_echo "#define wxUSE_STD_STRING_CONV_IN_WXSTRING 1" >>confdefs.h
@ -45225,7 +45261,6 @@ echo " wxWidgets 3.0 ${WXWIN_COMPATIB
echo " wxWidgets 3.2 ${WXWIN_COMPATIBILITY_3_2:-yes}"
echo " Which libraries should wxWidgets use?"
echo " STL ${wxUSE_STL}"
echo " jpeg ${wxUSE_LIBJPEG-none}"
echo " png ${wxUSE_LIBPNG-none}"
echo " regex ${wxUSE_REGEX}"