From dcf95e1cdc6d1b9fea0e423f6c6e736529d198dd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 17 Sep 2017 13:16:14 +0200 Subject: [PATCH] Change MSW version checks to work for yet unreleased versions wxGetWinVersion() will return wxWinVersion_Unknown for any MSW version not recognized by the version of wxWidgets used when building the application, so it makes sense to use a value higher than all currently known ones for this constant, so that the checks comparing the result of wxGetWinVersion() with any known version would still work correctly. E.g. comparisons like wxGetWinVersion() >= wxWinVersion_Vista will now continue to work for binaries built using the current wxWidgets even under some future Windows 11 OS version, unlike before. --- include/wx/msw/private.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index f168414805..fdea33ad91 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -902,8 +902,6 @@ inline wxString wxGetFullModuleName() // for the other Windows versions 0 is currently returned enum wxWinVersion { - wxWinVersion_Unknown = 0, - wxWinVersion_3 = 0x0300, wxWinVersion_NT3 = wxWinVersion_3, @@ -930,7 +928,11 @@ enum wxWinVersion wxWinVersion_8 = 0x602, wxWinVersion_8_1 = 0x603, - wxWinVersion_10 = 0x1000 + wxWinVersion_10 = 0x1000, + + // Any version we can't recognize will be later than the last currently + // known one, so give it a value greater than any in the known range. + wxWinVersion_Unknown = 0x7fff }; WXDLLIMPEXP_BASE wxWinVersion wxGetWinVersion();