| Summary: | SDL 1.2.15 fails to build on OSX 10.9 Mavericks – deprecated CGDirectPaletteRef was removed | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Adrian Petrescu <apetresc> |
| Component: | build | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | apetresc, sezeroz |
| Version: | 1.2.15 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X (All) | ||
| Attachments: |
patch to build on OS X 10.9 Mavericks
better fix for compiling for 10.6 and older |
||
I can confirm, anecdotally, that this patch works fine on Mavericks with several SDL-dependent projects such as Gource. Fixed, thanks! http://hg.libsdl.org/SDL/rev/e9466ead70e5 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 */
Created attachment 1324 [details]
better fix for compiling for 10.6 and older
Yes, that's a better fix. :) http://hg.libsdl.org/SDL/rev/bbfb41c13a87 Thanks! |
Created attachment 1320 [details] 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