Merge branch 'osx_version_stuff' of https://github.com/TcT2k/wxWidgets

Minor fixes for version-related stuff.
This commit is contained in:
Vadim Zeitlin 2015-08-10 18:44:20 +02:00
commit d9e2761ed4
2 changed files with 5 additions and 4 deletions

View File

@ -880,7 +880,7 @@ wxString wxGetOsDescription();
wxOperatingSystemId wxGetOsVersion(int* major = NULL, int* minor = NULL);
/**
Returns @true the version of the operating system on which the program
Returns @true if the version of the operating system on which the program
is running under is the same or later than the given version.
@since 3.1.0

View File

@ -636,9 +636,12 @@ wxOperatingSystemId wxGetOsVersion(int *majorVsn, int *minorVsn)
#endif
{
// On OS X versions prior to 10.10 NSProcessInfo does not provide the OS version
// Deprecated Gestalt calls are required instead
wxGCC_WARNING_SUPPRESS(deprecated-declarations)
SInt32 maj, min;
Gestalt(gestaltSystemVersionMajor, &maj);
Gestalt(gestaltSystemVersionMinor, &min);
wxGCC_WARNING_RESTORE()
if ( majorVsn != NULL )
*majorVsn = maj;
@ -675,10 +678,8 @@ bool wxCheckOsVersion(int majorVsn, int minorVsn)
wxString wxGetOsDescription()
{
NSString* osDesc = [NSProcessInfo processInfo].operatingSystemVersionString;
wxCFStringRef cf(wxCFRetain(osDesc));
return wxString::Format(wxT("Mac OS X %s"),
cf.AsString());
return wxString::Format("%s %s", _("Mac OS X"), wxCFStringRef::AsString(osDesc));
}
#endif // wxOSX_USE_COCOA