mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
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:
parent
5c55a3f1bd
commit
ab65e628d3
5 changed files with 50 additions and 13 deletions
|
@ -445,6 +445,20 @@ GSPrivateTimeNow(void)
|
|||
* value of the receiver and adding the interval in seconds specified.
|
||||
*/
|
||||
- (id) addTimeInterval: (NSTimeInterval)seconds
|
||||
{
|
||||
return [self dateByAddingTimeInterval: seconds];
|
||||
}
|
||||
|
||||
- (Class) classForCoder
|
||||
{
|
||||
return [self class];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates and returns a new NSCalendarDate object by taking the
|
||||
* value of the receiver and adding the interval specified.
|
||||
*/
|
||||
- (id) dateByAddingTimeInterval: (NSTimeInterval)seconds
|
||||
{
|
||||
id newObj = [[self class] dateWithTimeIntervalSinceReferenceDate:
|
||||
[self timeIntervalSinceReferenceDate] + seconds];
|
||||
|
@ -455,11 +469,6 @@ GSPrivateTimeNow(void)
|
|||
return newObj;
|
||||
}
|
||||
|
||||
- (Class) classForCoder
|
||||
{
|
||||
return [self class];
|
||||
}
|
||||
|
||||
- (id) replacementObjectForPortCoder: (NSPortCoder*)aRmc
|
||||
{
|
||||
return self;
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -105,7 +105,19 @@ static NSDate *theFuture = nil;
|
|||
|
||||
- (void) fire
|
||||
{
|
||||
[target performSelector: selector withObject: argument];
|
||||
NS_DURING
|
||||
{
|
||||
[target performSelector: selector withObject: argument];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"*** NSRunLoop ignoring exception '%@' (reason '%@') "
|
||||
@"raised during performSelector... with target %p "
|
||||
@"and selector '%@'",
|
||||
[localException name], [localException reason], target,
|
||||
NSStringFromSelector([target selector]));
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
|
||||
- (id) initWithSelector: (SEL)aSelector
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue