We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1965 - Mac: dead code for supporting OS 10.4
Summary: Mac: dead code for supporting OS 10.4
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: *don't know* (show other bugs)
Version: HG 2.0
Hardware: x86 Mac OS X (All)
: P2 trivial
Assignee: Alex Szpakowski
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-13 02:51 UTC by Alex Szpakowski
Modified: 2013-11-11 01:56 UTC (History)
0 users

See Also:


Attachments
Patch to remove pre-10.5 Cocoa code (9.67 KB, patch)
2013-07-13 15:18 UTC, Alex Szpakowski
Details | Diff
Removing obsolete codepaths (2.87 KB, patch)
2013-10-21 20:33 UTC, Alex Szpakowski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Szpakowski 2013-07-13 02:51:39 UTC
SDL 2.0's Cocoa codebase has some code there purely for the sake of supporting Mac OS 10.4 and below, even though SDL 2.0 now only supports 10.5 and up.
For the sake of a cleaner codebase it should probably be removed. :)
Comment 1 Sam Lantinga 2013-07-13 02:53:55 UTC
Sounds good.  Would you like to provide a tested patch?
Comment 2 Alex Szpakowski 2013-07-13 15:18:37 UTC
Created attachment 1231 [details]
Patch to remove pre-10.5 Cocoa code

I've attached a patch with my modifications so the source. I did some testing on Mac OS 10.8 and 10.5 but it was not extremely thorough.

I didn't remove this code: http://hg.libsdl.org/SDL/file/964e8876ad3b/src/video/cocoa/SDL_cocoawindow.m#l975 because I don't know whether it applies to 10.5+ as well or not.
Comment 3 Sam Lantinga 2013-10-21 07:33:55 UTC
This should mostly be done.  Can you verify the current snapshot?
http://www.libsdl.org/tmp/SDL-2.0.zip

Thanks!
Comment 4 Alex Szpakowski 2013-10-21 09:57:07 UTC
There's still a code path which is only taken for OS 10.2 and below, and some other misc. dead stuff. I'll make a patch to remove it tomorrow.

There is one thing I am not sure about. This comment is ambiguous as to whether the line is needed in 10.5+: http://hg.libsdl.org/SDL/file/4bb403bb0c06/src/video/cocoa/SDL_cocoawindow.m#l1030
So I won't remove it in my patch.
Comment 5 Alex Szpakowski 2013-10-21 20:33:37 UTC
Created attachment 1390 [details]
Removing obsolete codepaths

The new patch removes all the truly obsolete code I could find. I tested on OS 10.8 and OS 10.5.


It doesn't remove the setAppleMenu thing like my old patch did. I found out doing so broke the menu a little bit in 10.5.
Comment 6 Sam Lantinga 2013-11-11 01:56:30 UTC
Looks good, thanks!
https://hg.libsdl.org/SDL/rev/f5f51b3c4dd2