From 269450b2e01d9e3445c0e546dfa68f6c791a8a66 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Sun, 20 Feb 2011 11:12:35 +0000 Subject: [PATCH] make it compilable for Mac OSX Tiger (again) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37738 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/support/AppleSpeller.m | 8 ++++++++ src/support/linkback/LinkBackServer.m | 9 +++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/support/AppleSpeller.m b/src/support/AppleSpeller.m index b516e653ff..a50365c7cb 100644 --- a/src/support/AppleSpeller.m +++ b/src/support/AppleSpeller.m @@ -115,7 +115,11 @@ SpellCheckResult AppleSpeller_check(AppleSpeller speller, const char * word, con result = SPELL_CHECK_LEARNED; } } else { +#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1050) NSUInteger capacity = [speller->misspelled count] + 1; +#else + int capacity = [speller->misspelled count] + 1; +#endif NSMutableArray * misspelled = [NSMutableArray arrayWithCapacity:capacity]; [misspelled addObjectsFromArray:speller->misspelled]; [misspelled addObject:[NSValue valueWithRange:match]]; @@ -233,7 +237,11 @@ int AppleSpeller_numMisspelledWords(AppleSpeller speller) void AppleSpeller_misspelledWord(AppleSpeller speller, int index, int * start, int * length) { +#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1050) NSRange range = [[speller->misspelled objectAtIndex:(NSUInteger)index] rangeValue]; +#else + NSRange range = [[speller->misspelled objectAtIndex:index] rangeValue]; +#endif *start = range.location; *length = range.length; } diff --git a/src/support/linkback/LinkBackServer.m b/src/support/linkback/LinkBackServer.m index 0a51ac4067..bd6f90e837 100644 --- a/src/support/linkback/LinkBackServer.m +++ b/src/support/linkback/LinkBackServer.m @@ -72,7 +72,11 @@ NSMutableDictionary* LinkBackServers = nil ; BOOL LinkBackServerIsSupported(NSString* name, id supportedServers) { BOOL ret = NO ; +#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1050) NSUInteger idx ; +#else + int idx ; +#endif NSString* curServer = supportedServers ; // NOTE: supportedServers may be nil, an NSArray, or NSString. @@ -94,12 +98,13 @@ NSString* FindLinkBackServer(NSString* bundleIdentifier, NSString* serverName, N NSString* ret = nil ; NSFileManager* fm = [NSFileManager defaultManager] ; -#if defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) +#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && (__MAC_OS_X_VERSION_MAX_ALLOWED >= 1050) NSArray* contents = [fm contentsOfDirectoryAtPath: dir error: nil] ; + NSUInteger idx ; #else NSArray* contents = [fm directoryContentsAtPath: dir] ; + int idx ; #endif - NSUInteger idx ; // working info NSString* cpath ;