Adium

Changeset 23377

Show
Ignore:
Timestamp:
05/09/2008 12:34:58 PM (7 months ago)
Author:
evands
Message:

Don't use fast enumeration. Checking the MIN_REQUIRED isn't working, and I can't make myself care quite enough to figure out why since it's easy to just use a #define ENABLE_FAST_ENUMERATION FALSE to disable it. This fixes compilation on 10.4 systems and unbreaks Facebook support on 10.4.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Frameworks/JSON Framework/Source/NSObject+SBJSON.m

    r23362 r23377  
    2929 
    3030#import "NSObject+SBJSON.h" 
     31 
     32/* #define ENABLE_FAST_ENUMERATION MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 */ 
     33#define ENABLE_FAST_ENUMERATION FALSE 
    3134 
    3235typedef struct { 
     
    168171    if( x->indent ) [json appendString: open]; 
    169172    x->depth++; 
    170 #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 
    171     unsigned n = [self count]; 
    172     for (int i = 0; i < n; i++) { 
    173         id item = [self objectAtIndex:i]; 
    174 #else 
     173#if ENABLE_FAST_ENUMERATION 
    175174    int i=-1; 
    176175    for( id item in self ) { 
    177176        i++; 
     177#else 
     178        unsigned n = [self count]; 
     179        for (int i = 0; i < n; i++) { 
     180                id item = [self objectAtIndex:i];                        
    178181#endif 
    179182        if( i>0 ) [json appendString: sep]; 
     
    219222    x->depth++; 
    220223    NSArray *keys = [[self allKeys] sortedArrayUsingSelector:@selector(compare:)]; 
    221 #if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 
    222     unsigned n = [keys count]; 
     224#if ENABLE_FAST_ENUMERATION 
     225    int i=-1; 
     226    for( NSString *key in keys ) { 
     227        i++;             
     228#else 
     229        unsigned n = [keys count]; 
    223230    for (int i = 0; i < n; i++) { 
    224231        NSString *key = [keys objectAtIndex:i]; 
    225 #else 
    226     int i=-1; 
    227     for( NSString *key in keys ) { 
    228         i++; 
    229232#endif 
    230233        if( i>0 ) [json appendString: sep];