diff src/video/cocoa/SDL_cocoaevents.m @ 3624:9b1af1049f66

Merged r4866:4867 from branches/SDL-1.2: 64-bit Mac OS X 10.5 SDK fix.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 10 Jan 2010 05:39:46 +0000
parents e7eec78e4b92
children 4c5ab6841fdc
line wrap: on
line diff
--- a/src/video/cocoa/SDL_cocoaevents.m	Sun Jan 10 05:06:03 2010 +0000
+++ b/src/video/cocoa/SDL_cocoaevents.m	Sun Jan 10 05:39:46 2010 +0000
@@ -25,6 +25,15 @@
 #include "SDL_cocoavideo.h"
 #include "../../events/SDL_events_c.h"
 
+#if !defined(UsrActivity) && defined(__LP64__) && !defined(__POWER__)
+/*
+ * Workaround for a bug in the 10.5 SDK: By accident, OSService.h does
+ * not include Power.h at all when compiling in 64bit mode. This has
+ * been fixed in 10.6, but for 10.5, we manually define UsrActivity
+ * to ensure compilation works.
+ */
+#define UsrActivity 1
+#endif
 
 /* setAppleMenu disappeared from the headers in 10.4 */
 #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
@@ -167,8 +176,6 @@
     NSAutoreleasePool *pool;
 
     /* Update activity every 30 seconds to prevent screensaver */
-    /* FIXME: This define isn't available with 64-bit Mac OS X? */
-#ifdef UsrActivity
     if (_this->suspend_screensaver) {
         SDL_VideoData *data = (SDL_VideoData *)_this->driverdata;
         Uint32 now = SDL_GetTicks();
@@ -178,7 +185,6 @@
             data->screensaver_activity = now;
         }
     }
-#endif
 
     pool = [[NSAutoreleasePool alloc] init];
     while ([NSApp isRunning]) {