Author: lubosd
Date: Tue May  6 13:00:05 2014
New Revision: 37846

URL: http://svn.gna.org/viewcvs/gnustep?rev=37846&view=rev
Log:
* Source/NSCFDate.m,
  Source/CFDate.c: CFDateRef toll-free bridging


Added:
    libs/corebase/trunk/Source/NSCFDate.m
Modified:
    libs/corebase/trunk/ChangeLog
    libs/corebase/trunk/Source/CFDate.c

Modified: libs/corebase/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/ChangeLog?rev=37846&r1=37845&r2=37846&view=diff
==============================================================================
--- libs/corebase/trunk/ChangeLog       (original)
+++ libs/corebase/trunk/ChangeLog       Tue May  6 13:00:05 2014
@@ -1,3 +1,7 @@
+2014-05-06 Lubos Dolezel <[email protected]>
+       * Source/NSCFDate.m,
+         Source/CFDate.c: CFDateRef toll-free bridging
+
 2014-04-20 Lubos Dolezel <[email protected]>
        * Source/CFRunLoop.c,
          Tests/CFRunLoop/timers.m: CFRunLoop timer fixes and tests

Modified: libs/corebase/trunk/Source/CFDate.c
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Source/CFDate.c?rev=37846&r1=37845&r2=37846&view=diff
==============================================================================
--- libs/corebase/trunk/Source/CFDate.c (original)
+++ libs/corebase/trunk/Source/CFDate.c Tue May  6 13:00:05 2014
@@ -120,6 +120,9 @@
 CFAbsoluteTime
 CFDateGetAbsoluteTime (CFDateRef theDate)
 {
+  CF_OBJC_FUNCDISPATCHV(_kCFDateTypeID, CFAbsoluteTime, theDate,
+    "timeIntervalSinceReferenceDate");
+  
   return theDate->_absTime;
 }
 

Added: libs/corebase/trunk/Source/NSCFDate.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/corebase/trunk/Source/NSCFDate.m?rev=37846&view=auto
==============================================================================
--- libs/corebase/trunk/Source/NSCFDate.m       (added)
+++ libs/corebase/trunk/Source/NSCFDate.m       Tue May  6 13:00:05 2014
@@ -0,0 +1,71 @@
+/* NSCFError.m
+   
+   Copyright (C) 2014 Free Software Foundation, Inc.
+   
+   Written by: Lubos Dolezel
+   Date: May, 2014
+   
+   This file is part of the GNUstep CoreBase Library.
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; see the file COPYING.LIB.
+   If not, see <http://www.gnu.org/licenses/> or write to the 
+   Free Software Foundation, 51 Franklin Street, Fifth Floor, 
+   Boston, MA 02110-1301, USA.
+*/
+
+#import <Foundation/NSObject.h>
+#import <Foundation/NSDate.h>
+#import <Foundation/NSString.h>
+
+#include "NSCFType.h"
+#include "CoreFoundation/CFDate.h"
+
+@interface NSCFDate : NSDate
+NSCFTYPE_VARS
+@end
+
+@interface NSDate (CoreBaseAdditions)
+- (CFTypeID) _cfTypeID;
+@end
+
+@implementation NSCFDate
++ (void) load
+{
+  NSCFInitialize ();
+}
+
++ (void) initialize
+{
+  GSObjCAddClassBehavior (self, [NSCFType class]);
+}
+
+- (id)initWithTimeIntervalSinceReferenceDate:(NSTimeInterval)seconds
+{
+  RELEASE(self);
+
+  return (NSCFDate*) CFDateCreate(NULL, seconds);
+}
+
+- (NSTimeInterval)timeIntervalSinceReferenceDate
+{
+  return CFDateGetAbsoluteTime((CFDateRef) self);
+}
+@end
+
+@implementation NSDate (CoreBaseAdditions)
+- (CFTypeID) _cfTypeID
+{
+  return CFDateGetTypeID();
+}
+@end


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to