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

Fix for compiling with 10.6 SDK #74

Closed
wants to merge 1 commit into from

Conversation

pcwalton
Copy link
Contributor

Hi,

Currently GLFW does not compile on Mac OS X 10.6 (although it runs). This is because convertRectToBacking: returns an NSRect, but undefined methods in Objective-C are assumed to return id. Unfortunately id is not castable to NSRect, so the build fails.

This patch fixes this problem using a category. Maybe there's a better way, but this seemed to work. Tested on OS X 10.6 and OS X 10.8.

@nilium
Copy link
Contributor

nilium commented Jun 27, 2013

I don't think this is the right solution to the problem. The original one was to use the preprocessor to exclude the call altogether when the SDK wasn't available. Used in addition to checking for whether the window responds to a method, that's probably a better solution than re-defining APIs provided by the SDK (which could prove problematic). Still, you should probably download a more recent SDK to compile against (but set 10.6 as your minimum), though I'm not sure what SDKs are available to those stuck on 10.6 for whatever reason.

Either way, I'd really, really recommend against this particular solution to the problem, seeing as it's re-defining one of Apple's methods, which could change later. It probably won't change, of course, but I wouldn't use an assumption to justify bad code.

@ghost ghost assigned elmindreda Jul 4, 2013
@elmindreda
Copy link
Member

Compilation with the 10.6 SDK should work as of 58c69a9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports and bugfix pull requests macOS verified Reproduced or otherwise verified bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants