Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove: Support for macOS before 10.9 #8025

Closed
wants to merge 4 commits into from

Conversation

nielsmh
Copy link
Contributor

@nielsmh nielsmh commented Feb 26, 2020

Remove all assumptions and code paths that are only relevant for builds intended to support macOS earlier than 10.9. This simplifies the Cocoa video driver a lot and makes it much easier to follow the code.

So far this is barely just smoke-tested on my own machine with macOS 10.13.

@orudge
Copy link
Contributor

orudge commented Feb 27, 2020

If we're dropping support for <10.9, the enable_osx_g5-related stuff can go too, since OS X hasn't run on PPC since 10.5.

@glx22
Copy link
Contributor

glx22 commented Feb 29, 2020

If I correctly understand https://developer.apple.com/documentation/coreservices/carbon_core/gestalt_manager?language=objc the following blocks can be removed too

#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10)
typedef struct {
NSInteger majorVersion;
NSInteger minorVersion;
NSInteger patchVersion;
} OTTDOperatingSystemVersion;
#define NSOperatingSystemVersion OTTDOperatingSystemVersion
#endif

#if (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_10)
SInt32 systemVersion, version_major, version_minor, version_bugfix;
if (Gestalt(gestaltSystemVersion, &systemVersion) == noErr) {
if (systemVersion >= 0x1040) {
if (Gestalt(gestaltSystemVersionMajor, &version_major) == noErr) *return_major = (int)version_major;
if (Gestalt(gestaltSystemVersionMinor, &version_minor) == noErr) *return_minor = (int)version_minor;
if (Gestalt(gestaltSystemVersionBugFix, &version_bugfix) == noErr) *return_bugfix = (int)version_bugfix;
} else {
*return_major = (int)(GB(systemVersion, 12, 4) * 10 + GB(systemVersion, 8, 4));
*return_minor = (int)GB(systemVersion, 4, 4);
*return_bugfix = (int)GB(systemVersion, 0, 4);
}
}
#endif

That should remove the deprecated warnings.

And I think some other conditional stuff in this file can be removed too.

@michicc
Copy link
Member

michicc commented Feb 29, 2020

Unfortunately, the alternative to Gestalt was only introduced in 10.10 (see https://developer.apple.com/documentation/foundation/nsprocessinfo/1410906-operatingsystemversion?language=objc). 10.9 has no official, non-deprecated system function.

@nielsmh
Copy link
Contributor Author

nielsmh commented Apr 10, 2020

Closing in favour of #8078 - I don't see myself finishing or cleaning up this one any time soon.

@nielsmh nielsmh closed this Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants