diff options
author | Damien Plisson <damien.plisson@yahoo.fr> | 2010-01-01 18:48:14 +0300 |
---|---|---|
committer | Damien Plisson <damien.plisson@yahoo.fr> | 2010-01-01 18:48:14 +0300 |
commit | 4ab4d2dd20791101215b39609bf174762e42e58d (patch) | |
tree | da48e2dcbb86621e3cb764e3abdd219899517be8 /intern | |
parent | 30aff3b830ac222bae90bea02fef0d41fd9d197c (diff) |
Fix some build warnings
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 25 |
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 |