]> git.lyx.org Git - lyx.git/commitdiff
make it compilable for Mac OSX Tiger (again)
authorStephan Witt <switt@lyx.org>
Sun, 20 Feb 2011 11:12:35 +0000 (11:12 +0000)
committerStephan Witt <switt@lyx.org>
Sun, 20 Feb 2011 11:12:35 +0000 (11:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37738 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/AppleSpeller.m
src/support/linkback/LinkBackServer.m

index b516e653fff1cb9a651d899d104d751685fc42be..a50365c7cb926d04fd48251820b6034ae55082a2 100644 (file)
@@ -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;
 }
index 0a51ac4067ca4e7691f8218ff3213ca5b453826c..bd6f90e837df71dbdf9c388e2c5cf7ea92fe0d6e 100644 (file)
@@ -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 ;