Merge support for OS and toolkit micro versions
Closes https://github.com/wxWidgets/wxWidgets/pull/234
This commit is contained in:
@@ -139,12 +139,14 @@ wxPlatformInfo::wxPlatformInfo(wxPortId pid, int tkMajor, int tkMinor,
|
||||
|
||||
m_tkVersionMajor = tkMajor;
|
||||
m_tkVersionMinor = tkMinor;
|
||||
m_tkVersionMicro = -1;
|
||||
m_port = pid;
|
||||
m_usingUniversal = usingUniversal;
|
||||
|
||||
m_os = id;
|
||||
m_osVersionMajor = osMajor;
|
||||
m_osVersionMinor = osMinor;
|
||||
m_osVersionMicro = -1;
|
||||
|
||||
m_endian = endian;
|
||||
m_arch = arch;
|
||||
@@ -154,8 +156,10 @@ bool wxPlatformInfo::operator==(const wxPlatformInfo &t) const
|
||||
{
|
||||
return m_tkVersionMajor == t.m_tkVersionMajor &&
|
||||
m_tkVersionMinor == t.m_tkVersionMinor &&
|
||||
m_tkVersionMicro == t.m_tkVersionMicro &&
|
||||
m_osVersionMajor == t.m_osVersionMajor &&
|
||||
m_osVersionMinor == t.m_osVersionMinor &&
|
||||
m_osVersionMicro == t.m_osVersionMicro &&
|
||||
m_os == t.m_os &&
|
||||
m_osDesc == t.m_osDesc &&
|
||||
m_ldi == t.m_ldi &&
|
||||
@@ -179,16 +183,18 @@ void wxPlatformInfo::InitForCurrentPlatform()
|
||||
m_port = wxPORT_UNKNOWN;
|
||||
m_usingUniversal = false;
|
||||
m_tkVersionMajor =
|
||||
m_tkVersionMinor = 0;
|
||||
m_tkVersionMinor =
|
||||
m_tkVersionMicro = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_port = traits->GetToolkitVersion(&m_tkVersionMajor, &m_tkVersionMinor);
|
||||
m_port = traits->GetToolkitVersion(&m_tkVersionMajor, &m_tkVersionMinor,
|
||||
&m_tkVersionMicro);
|
||||
m_usingUniversal = traits->IsUsingUniversalWidgets();
|
||||
m_desktopEnv = traits->GetDesktopEnvironment();
|
||||
}
|
||||
|
||||
m_os = wxGetOsVersion(&m_osVersionMajor, &m_osVersionMinor);
|
||||
m_os = wxGetOsVersion(&m_osVersionMajor, &m_osVersionMinor, &m_osVersionMicro);
|
||||
m_osDesc = wxGetOsDescription();
|
||||
m_endian = wxIsPlatformLittleEndian() ? wxENDIAN_LITTLE : wxENDIAN_BIG;
|
||||
m_arch = wxIsPlatform64Bit() ? wxARCH_64 : wxARCH_32;
|
||||
@@ -298,18 +304,20 @@ wxString wxPlatformInfo::GetEndiannessName(wxEndianness end)
|
||||
return wxEndiannessNames[end];
|
||||
}
|
||||
|
||||
bool wxPlatformInfo::CheckOSVersion(int major, int minor) const
|
||||
bool wxPlatformInfo::CheckOSVersion(int major, int minor, int micro) const
|
||||
{
|
||||
// If this instance of wxPlatformInfo has been initialized by InitForCurrentPlatform()
|
||||
// this check gets forwarded to the wxCheckOsVersion which might do more than a simple
|
||||
// number check if supported by the platform
|
||||
if (m_initializedForCurrentPlatform)
|
||||
return wxCheckOsVersion(major, minor);
|
||||
return wxCheckOsVersion(major, minor, micro);
|
||||
else
|
||||
return DoCheckVersion(GetOSMajorVersion(),
|
||||
GetOSMinorVersion(),
|
||||
GetOSMicroVersion(),
|
||||
major,
|
||||
minor);
|
||||
minor,
|
||||
micro);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user