[vlc-commits] macosx: compilation fix for 10.5 and 10.6

Felix Paul Kühne git at videolan.org
Mon Oct 15 15:45:07 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Oct 15 15:45:01 2012 +0200| [5884109823cdcb42fd49d7b681455d7b20acace9] | committer: Felix Paul Kühne

macosx: compilation fix for 10.5 and 10.6

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=5884109823cdcb42fd49d7b681455d7b20acace9
---

 modules/gui/macosx/CompatibilityFixes.h |   10 +++-------
 modules/gui/macosx/intf.m               |    8 ++++++--
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/modules/gui/macosx/CompatibilityFixes.h b/modules/gui/macosx/CompatibilityFixes.h
index 62edaa4..be538c8 100644
--- a/modules/gui/macosx/CompatibilityFixes.h
+++ b/modules/gui/macosx/CompatibilityFixes.h
@@ -80,13 +80,6 @@ extern OSErr UpdateSystemActivity(UInt8 activity);
 - (NSArray *)pathComponents;
 @end
 
-IOReturn IOPMAssertionCreateWithName( CFStringRef AssertionType,
-                                      IOPMAssertionLevel AssertionLevel,
-                                      CFStringRef AssertionName,
-                                      IOPMAssertionID *AssertionID );
-#define kIOPMAssertionTypePreventUserIdleDisplaySleep    CFSTR("PreventUserIdleDisplaySleep");
-#define kIOPMAssertionTypePreventUserIdleSystemSleep    CFSTR("PreventUserIdleSystemSleep");
-
 #endif
 
 #pragma mark -
@@ -116,4 +109,7 @@ enum {
 - (BOOL)isDirectionInvertedFromDevice;
 @end
 
+#define kIOPMAssertionTypePreventUserIdleDisplaySleep    CFSTR("PreventUserIdleDisplaySleep")
+#define kIOPMAssertionTypePreventUserIdleSystemSleep    CFSTR("PreventUserIdleSystemSleep")
+
 #endif
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 61a58e9..097492a 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -1598,8 +1598,9 @@ unsigned int CocoaKeyToVLC( unichar i_key )
                     systemSleepAssertionID = 0;
             }
 
+            #ifdef __x86_64__
             /* prevent the system from sleeping using the 10.5 API to be as compatible as possible */
-            /* work-around a bug in 10.7.4 and 10.7.5, so check for 10.7.x < 10.7.4, 10.8 and 10.6 */
+            /* work-around a bug in 10.7.4 and 10.7.5, so check for 10.7.x < 10.7.4 and 10.8 */
             if ((NSAppKitVersionNumber >= 1115.2 && NSAppKitVersionNumber < 1138.45) || OSX_MOUNTAIN_LION) {
                 CFStringRef reasonForActivity= CFStringCreateWithCString(kCFAllocatorDefault, "VLC media playback", kCFStringEncodingUTF8);
                 if ([self activeVideoPlayback]) {
@@ -1611,12 +1612,15 @@ unsigned int CocoaKeyToVLC( unichar i_key )
                     }
                 CFRelease(reasonForActivity);
             } else {
-                /* fall-back on the 10.5 mode, which also works on 10.7.4 and 10.7.5 */
+            #endif
+                /* fall-back on the 10.5 mode, which also works on 10.6, 10.7.4 and 10.7.5 */
                 if ([self activeVideoPlayback])
                     success = IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &systemSleepAssertionID);
                 else
                     success = IOPMAssertionCreate(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, &systemSleepAssertionID);
+            #ifdef __x86_64__
             }
+            #endif
 
             if (success == kIOReturnSuccess)
                 msg_Dbg( VLCIntf, "prevented sleep through IOKit (%i)", systemSleepAssertionID);



More information about the vlc-commits mailing list