mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Implement NSDate as a small object (tagged pointer) - clang/libobjc2 only (#451)
* Implement GSSmallObject Class * Remove private concrete class access * Change secondary bias * NSDate: Get interval from rhs object in comparison * Add prefix to CONCRETE_CLASS_NAME macro
This commit is contained in:
parent
1cb846e607
commit
8fd2c06ddd
6 changed files with 710 additions and 315 deletions
|
@ -12,7 +12,7 @@
|
|||
#ifdef EQ
|
||||
#undef EQ
|
||||
#endif
|
||||
#define EPSILON (FLT_EPSILON*100)
|
||||
#define EPSILON (DBL_EPSILON*100)
|
||||
#define EQ(x,y) ((x >= y - EPSILON) && (x <= y + EPSILON))
|
||||
|
||||
@interface MyHandler : NSObject
|
||||
|
@ -204,6 +204,7 @@ int main()
|
|||
NSTimeInterval ot, nt;
|
||||
ot = [[oa fileCreationDate] timeIntervalSinceReferenceDate];
|
||||
nt = [[na fileCreationDate] timeIntervalSinceReferenceDate];
|
||||
NSLog(@"ot = %f, nt = %f", ot, nt);
|
||||
PASS(EQ(ot, nt), "copy creation date equals original")
|
||||
ot = [[oa fileModificationDate] timeIntervalSinceReferenceDate];
|
||||
nt = [[na fileModificationDate] timeIntervalSinceReferenceDate];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue