OSX compatibility tweaks inspiered by testplant

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35555 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2012-09-10 05:18:09 +00:00
parent 5c55a3f1bd
commit ab65e628d3
5 changed files with 50 additions and 13 deletions

View file

@ -1132,6 +1132,12 @@ otherTime(NSDate* other)
return self;
}
- (id) dateByAddingTimeInterval: (NSTimeInterval)seconds
{
return [[self class] dateWithTimeIntervalSinceReferenceDate:
otherTime(self) + seconds];
}
/**
* Returns an autoreleased instance of the [NSCalendarDate] class whose
* date/time value is the same as that of the receiver, and which uses
@ -1203,15 +1209,9 @@ otherTime(NSDate* other)
return [s autorelease];
}
/**
* Returns an autoreleased NSDate instance whose value if offset from
* that of the receiver by seconds.
*/
- (id) addTimeInterval: (NSTimeInterval)seconds
{
/* xxx We need to check for overflow? */
return [[self class] dateWithTimeIntervalSinceReferenceDate:
otherTime(self) + seconds];
return [self dateByAddingTimeInterval: seconds];
}
/**