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

SDL 1.2.15 fails to build on OSX 10.9 Mavericks – deprecated CGDirectPaletteRef was removed #739

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

These attachments are available in the static archive:

Reported in version: 1.2.15
Reported for operating system, platform: Mac OS X (All), x86_64

Comments on the original bug report:

On 2013-09-03 21:47:32 +0000, Adrian Petrescu wrote:

Created attachment 1320
patch to build on OS X 10.9 Mavericks

The CGDirectPaletteRef struct no longer exists in 10.9 (it had been previously deprecated) which prevents SDL 1.2.15 from building with the following error:

In file included from ./src/video/quartz/SDL_QuartzEvents.m:24:
./src/video/quartz/SDL_QuartzVideo.h:94:5: error: unknown type name 'CGDirectPaletteRef'
    CGDirectPaletteRef palette;            /* palette of an 8-bit display */
    ^

I was able to make everything compile just by removing that item from the struct, nothing else in libsdl seems to depend on it, but I have no idea if this is a valid fix, knowing next to nothing about SDL.

I've attached the patch. Hopefully it's fine.

Cheers,
Adrian Petrescu

On 2013-09-03 22:51:32 +0000, Adrian Petrescu wrote:

I can confirm, anecdotally, that this patch works fine on Mavericks with several SDL-dependent projects such as Gource.

On 2013-09-05 13:40:21 +0000, Sam Lantinga wrote:

Fixed, thanks!
http://hg.libsdl.org/SDL/rev/e9466ead70e5

On 2013-09-07 04:57:27 +0000, Ozkan Sezer wrote:

This patch seems wrong: SDL_QuartzVideo.m still plays with the palette member
when compiled for 10.6 and older. I think the following would be a better fix
(also attaching in case it gets mangled) :

--- SDL-1.2/src/video/quartz/SDL_QuartzVideo.h~
+++ SDL-1.2/src/video/quartz/SDL_QuartzVideo.h
@@ -91,6 +91,9 @@
CGDirectDisplayID display; /* 0 == main display (only support single display) */
const void mode; / current mode of the display */
const void save_mode; / original mode of the display */
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 1070)

  • CGDirectPaletteRef palette; /* palette of an 8-bit display */
    +#endif
    NSOpenGLContext gl_context; / OpenGL rendering context */
    NSGraphicsContext nsgfx_context; / Cocoa graphics context /
    Uint32 width, height, bpp; /
    frequently used data about the display */

On 2013-09-07 04:58:45 +0000, Ozkan Sezer wrote:

Created attachment 1324
better fix for compiling for 10.6 and older

On 2013-09-07 06:38:23 +0000, Sam Lantinga wrote:

Yes, that's a better fix. :)
http://hg.libsdl.org/SDL/rev/bbfb41c13a87
Thanks!

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

No branches or pull requests

1 participant