Add wxSUBRELEASE_NUMBER to wxGetLibraryVersionInfo() if non-zero

Keep using just the first three components of the version if
wxSUBRELEASE_NUMBER is 0, but do add it to the version if it isn't, to
allow distinguishing x.y.z releases from x.y.z.w hot-fixes.

(cherry picked from commit cb41471093a4b43f69aaa59557ffef7e81689849)
This commit is contained in:
Vadim Zeitlin 2023-02-13 22:49:28 +01:00
parent 393b57511c
commit 17d7cf3a5a

View File

@ -1384,18 +1384,28 @@ int wxMessageBox(const wxString& message, const wxString& caption, long style,
wxVersionInfo wxGetLibraryVersionInfo()
{
// Only add the last build component to the version if it's non-zero, it's
// pretty useless otherwise.
wxString ver = wxString::Format
(
wxS("%d.%d.%d"),
wxMAJOR_VERSION,
wxMINOR_VERSION,
wxRELEASE_NUMBER
);
if ( wxSUBRELEASE_NUMBER )
ver += wxString::Format(wxS(".%d"), wxSUBRELEASE_NUMBER);
// don't translate these strings, they're for diagnostics purposes only
wxString msg;
msg.Printf(wxS("wxWidgets Library (%s port)\n")
wxS("Version %d.%d.%d (Unicode: %s, debug level: %d),\n")
wxS("Version %s (Unicode: %s, debug level: %d),\n")
#if !wxUSE_REPRODUCIBLE_BUILD
wxS("compiled at %s %s\n\n")
#endif
wxS("Runtime version of toolkit used is %d.%d.\n"),
wxPlatformInfo::Get().GetPortIdName(),
wxMAJOR_VERSION,
wxMINOR_VERSION,
wxRELEASE_NUMBER,
ver,
#if wxUSE_UNICODE_UTF8
"UTF-8",
#elif wxUSE_UNICODE