Fixed building on Mac OS X with Xcode 4.4 (OS X 10.8 SDK).
authorRyan C. Gordon <icculus@icculus.org>
Thu, 09 Aug 2012 15:43:39 -0400
changeset 6391ae8952e7e769
parent 6390 3047baa4a5e0
child 6392 fa7eb111f994
Fixed building on Mac OS X with Xcode 4.4 (OS X 10.8 SDK).

I think you'll need to install Xquartz, the external-but-official replacement
for Apple's X11, to get the Xlib headers: http://support.apple.com/kb/HT5293
include/SDL_config_macosx.h
     1.1 --- a/include/SDL_config_macosx.h	Thu Aug 09 14:28:45 2012 -0400
     1.2 +++ b/include/SDL_config_macosx.h	Thu Aug 09 15:43:39 2012 -0400
     1.3 @@ -139,17 +139,23 @@
     1.4  #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
     1.5  #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
     1.6  #define SDL_VIDEO_DRIVER_X11_XINERAMA 1
     1.7 -/* 
     1.8 -not included with Mac OS X at the moment...
     1.9 -#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
    1.10 -#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
    1.11 -*/
    1.12  #define SDL_VIDEO_DRIVER_X11_XRANDR 1
    1.13  #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
    1.14  #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
    1.15  #define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
    1.16  #define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
    1.17  
    1.18 +#ifdef MAC_OS_X_VERSION_10_8
    1.19 +/*
    1.20 + * No matter the versions targeted, this is the 10.8 or later SDK, so you have
    1.21 + *  to use the external Xquartz, which is a more modern Xlib. Previous SDKs
    1.22 + *  used an older Xlib.
    1.23 + */
    1.24 +#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
    1.25 +#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
    1.26 +#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
    1.27 +#endif
    1.28 +
    1.29  #ifndef SDL_VIDEO_RENDER_OGL
    1.30  #define SDL_VIDEO_RENDER_OGL	1
    1.31  #endif