On Mon, Aug 29, 2011 at 3:39 PM, Stefan Bidi <stefanb...@gmail.com> wrote:
> Oh, I see.  Actually, that's a copy-paste mistake I made when using Etoile's
> code.  CF doesn't define BOOL, YES and NO, it uses Boolean, true and false
> instead.  I won't be able to get to this anytime today, so if you're in a
> hurry to get this patch in, could you make that change?  If not, I'll get to
> it whenever I can.

no... not in any hurry, here you go though...
Index: Source/objc_interface.h
===================================================================
--- Source/objc_interface.h	(revision 33795)
+++ Source/objc_interface.h	(working copy)
@@ -28,7 +28,7 @@
 #define __OBJC_INTERFACE_H__ 1
 
 #include "CoreFoundation/CFRuntime.h"
-#include <GNUstepBase/preface.h>
+#include <objc/runtime.h>
 
 
 
@@ -54,7 +54,7 @@
 CF_IS_OBJC (CFTypeID typeID, const void *obj)
 {
   return (typeID >= __CFRuntimeClassTableCount
-          || object_getClass(obj) != __CFISAForTypeID (typeID));
+          || object_getClass((id)obj) != __CFISAForTypeID (typeID));
 }
 
 #define CF_OBJC_FUNCDISPATCH0(typeID, rettype, obj, sel) do { \
Index: Source/NSCFType.m
===================================================================
--- Source/NSCFType.m	(revision 33795)
+++ Source/NSCFType.m	(working copy)
@@ -43,11 +43,6 @@
 
 @implementation NSCFType
 
-+ (void) load
-{
-  CFInitialize();
-}
-
 - (id) retain
 {
   return (id)CFRetain(self);
Index: Source/CFRuntime.m
===================================================================
--- Source/CFRuntime.m	(revision 33795)
+++ Source/CFRuntime.m	(working copy)
@@ -379,7 +379,7 @@
 extern void CFTimeZoneInitialize (void);
 extern void CFUUIDInitialize (void);
 
-void CFInitialize (void)
+void __attribute__((constructor(65535))) CFInitialize (void)
 {
   // Initialize CFRuntimeClassTable
   __CFRuntimeClassTable = (CFRuntimeClass **) calloc (__CFRuntimeClassTableSize,
Index: Source/CFUUID.c
===================================================================
--- Source/CFUUID.c	(revision 33795)
+++ Source/CFUUID.c	(working copy)
@@ -56,7 +56,7 @@
 	int fd;
 	unsigned int seed = 0;
 	size_t len = sizeof(seed);
-	BOOL hasSeed = NO;
+	Boolean hasSeed = false;
   
 	fd = open("/dev/random", O_RDONLY | O_NONBLOCK, 0);
 	if (fd >= 0) 
@@ -64,12 +64,12 @@
       if (errno != EWOULDBLOCK)
         {
           if (read(fd, &seed, len) == (ssize_t)len)
-            hasSeed = YES;
+            hasSeed = true;
         }
       close(fd);
     }
   
-	if (hasSeed == NO) 
+	if (hasSeed == false) 
     {
       struct timeval tv;
       unsigned long junk;
Index: Source/CFBase.m
===================================================================
--- Source/CFBase.m	(revision 33795)
+++ Source/CFBase.m	(working copy)
@@ -250,7 +250,8 @@
 void CFNullInitialize (void)
 {
   _kCFNullTypeID = _CFRuntimeRegisterClass (&CFNullClass);
-  ((CFRuntimeBase*)kCFNull)->_isa = [NSNull class];
+  /* don't use [NSNull class] before autorelease pool setup. */
+  ((CFRuntimeBase*)kCFNull)->_isa = objc_getClass("NSNull");
 }
 
 CFTypeID
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33795)
+++ ChangeLog	(working copy)
@@ -1,3 +1,13 @@
+2011-08-28  Matt Rice  <ratm...@gmail.com>
+
+	* Source/objc_interface.h: Remove referene to preface.h
+	add runtime.h.
+	(CF_IS_OBJC): Add cast to avoid warning.
+	* Source/NSCFType.m (+load): Remove method.
+	* Source/CFRuntime.m: Add constructor attribute with last priority.
+	* Source/CFUUID.m: Replace BOOL/YES/NO with Boolean/true/false.
+	* Source/CFBase (CFNullInitialize): Avoid +initialize.
+
 2011-07-20 Stefan Bidigaray <stefanb...@gmail.com>
 
 	* Source/CFDate.c:
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to