Merged r4866:4867 from branches/SDL-1.2: 64-bit Mac OS X 10.5 SDK fix.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 10 Jan 2010 05:39:46 +0000
changeset 36249b1af1049f66
parent 3623 9a73fecd9181
child 3625 83910f4c373f
Merged r4866:4867 from branches/SDL-1.2: 64-bit Mac OS X 10.5 SDK fix.
src/video/cocoa/SDL_cocoaevents.m
     1.1 --- a/src/video/cocoa/SDL_cocoaevents.m	Sun Jan 10 05:06:03 2010 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoaevents.m	Sun Jan 10 05:39:46 2010 +0000
     1.3 @@ -25,6 +25,15 @@
     1.4  #include "SDL_cocoavideo.h"
     1.5  #include "../../events/SDL_events_c.h"
     1.6  
     1.7 +#if !defined(UsrActivity) && defined(__LP64__) && !defined(__POWER__)
     1.8 +/*
     1.9 + * Workaround for a bug in the 10.5 SDK: By accident, OSService.h does
    1.10 + * not include Power.h at all when compiling in 64bit mode. This has
    1.11 + * been fixed in 10.6, but for 10.5, we manually define UsrActivity
    1.12 + * to ensure compilation works.
    1.13 + */
    1.14 +#define UsrActivity 1
    1.15 +#endif
    1.16  
    1.17  /* setAppleMenu disappeared from the headers in 10.4 */
    1.18  #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
    1.19 @@ -167,8 +176,6 @@
    1.20      NSAutoreleasePool *pool;
    1.21  
    1.22      /* Update activity every 30 seconds to prevent screensaver */
    1.23 -    /* FIXME: This define isn't available with 64-bit Mac OS X? */
    1.24 -#ifdef UsrActivity
    1.25      if (_this->suspend_screensaver) {
    1.26          SDL_VideoData *data = (SDL_VideoData *)_this->driverdata;
    1.27          Uint32 now = SDL_GetTicks();
    1.28 @@ -178,7 +185,6 @@
    1.29              data->screensaver_activity = now;
    1.30          }
    1.31      }
    1.32 -#endif
    1.33  
    1.34      pool = [[NSAutoreleasePool alloc] init];
    1.35      while ([NSApp isRunning]) {