Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorDamien Plisson <damien.plisson@yahoo.fr>2010-01-01 18:48:14 +0300
committerDamien Plisson <damien.plisson@yahoo.fr>2010-01-01 18:48:14 +0300
commit4ab4d2dd20791101215b39609bf174762e42e58d (patch)
treeda48e2dcbb86621e3cb764e3abdd219899517be8 /intern
parent30aff3b830ac222bae90bea02fef0d41fd9d197c (diff)
Fix some build warnings
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm25
1 files changed, 20 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index 71465822bee..e9d34534fcf 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -374,6 +374,25 @@ static GHOST_TKey convertKey(int rawCode, unichar recvChar)
}
+#pragma mark defines for 10.6 api not documented in 10.5
+#ifndef MAC_OS_X_VERSION_10_6
+
+@interface NSEvent(SnowLeopardEvents)
+/* modifier keys currently down. This returns the state of devices combined
+ with synthesized events at the moment, independent of which events
+ have been delivered via the event stream. */
+#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
++ (unsigned int)modifierFlags; //NSUInteger is defined only from 10.5
+#else
++ (NSUInteger)modifierFlags;
+#endif
+@end
+
+#endif
+
+
+#pragma mark Utility functions
+
#define FIRSTFILEBUFLG 512
static bool g_hasFirstFile = false;
static char g_firstFileBuf[512];
@@ -883,11 +902,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleApplicationBecomeActiveEvent()
#else
//If build against an older SDK, check if running on 10.6 to use the correct function
if ([NSEvent respondsToSelector:@selector(modifierFlags)]) {
-#if MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4
- modifiers = (unsigned int)[NSEvent modifierFlags];
-#else
- modifiers = (NSUInteger)[NSEvent modifierFlags];
-#endif
+ modifiers = [NSEvent modifierFlags];
}
else {
//TODO: need to find a better workaround for the missing cocoa "getModifierFlag" function in 10.4/10.5