Fixed bug 2085 - SDL 1.2.15 fails to build on OSX 10.9 Mavericks – deprecated CGDirectPaletteRef was removed SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Thu, 05 Sep 2013 06:38:57 -0700
branchSDL-1.2
changeset 7726e9466ead70e5
parent 7625 952791dbe6ba
child 7734 bbfb41c13a87
Fixed bug 2085 - SDL 1.2.15 fails to build on OSX 10.9 Mavericks – deprecated CGDirectPaletteRef was removed

Adrian Petrescu

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.
src/video/quartz/SDL_QuartzVideo.h
     1.1 --- a/src/video/quartz/SDL_QuartzVideo.h	Sat Aug 10 10:54:03 2013 -0700
     1.2 +++ b/src/video/quartz/SDL_QuartzVideo.h	Thu Sep 05 06:38:57 2013 -0700
     1.3 @@ -91,7 +91,6 @@
     1.4      CGDirectDisplayID  display;            /* 0 == main display (only support single display) */
     1.5      const void         *mode;              /* current mode of the display */
     1.6      const void         *save_mode;         /* original mode of the display */
     1.7 -    CGDirectPaletteRef palette;            /* palette of an 8-bit display */
     1.8      NSOpenGLContext    *gl_context;        /* OpenGL rendering context */
     1.9      NSGraphicsContext  *nsgfx_context;     /* Cocoa graphics context */
    1.10      Uint32             width, height, bpp; /* frequently used data about the display */