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 6391 ae8952e7e769
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
--- a/include/SDL_config_macosx.h	Thu Aug 09 14:28:45 2012 -0400
+++ b/include/SDL_config_macosx.h	Thu Aug 09 15:43:39 2012 -0400
@@ -139,17 +139,23 @@
 #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib"
 #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib"
 #define SDL_VIDEO_DRIVER_X11_XINERAMA 1
-/* 
-not included with Mac OS X at the moment...
-#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
-#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
-*/
 #define SDL_VIDEO_DRIVER_X11_XRANDR 1
 #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1
 #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
 #define SDL_VIDEO_DRIVER_X11_XVIDMODE 1
 #define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1
 
+#ifdef MAC_OS_X_VERSION_10_8
+/*
+ * No matter the versions targeted, this is the 10.8 or later SDK, so you have
+ *  to use the external Xquartz, which is a more modern Xlib. Previous SDKs
+ *  used an older Xlib.
+ */
+#define SDL_VIDEO_DRIVER_X11_XINPUT2 1
+#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1
+#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1
+#endif
+
 #ifndef SDL_VIDEO_RENDER_OGL
 #define SDL_VIDEO_RENDER_OGL	1
 #endif