[macruby-changes] [756] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 24 19:13:56 PST 2008


Revision: 756
          http://trac.macosforge.org/projects/ruby/changeset/756
Author:   lsansonetti at apple.com
Date:     2008-11-24 19:13:55 -0800 (Mon, 24 Nov 2008)
Log Message:
-----------
fix for #168

Modified Paths:
--------------
    MacRuby/trunk/bs.c
    MacRuby/trunk/objc.m

Modified: MacRuby/trunk/bs.c
===================================================================
--- MacRuby/trunk/bs.c	2008-11-25 00:06:41 UTC (rev 755)
+++ MacRuby/trunk/bs.c	2008-11-25 03:13:55 UTC (rev 756)
@@ -570,11 +570,11 @@
           enum_name = get_attribute(reader, "name");
           CHECK_ATTRIBUTE(enum_name, "name");
 
-          enum_value = get_attribute(reader, "value");
 #if __LP64__
-          if (enum_value == NULL)
-            enum_value = get_attribute(reader, "value64");
+	  enum_value = get_attribute(reader, "value64");
+	  if (enum_value == NULL)
 #endif
+	    enum_value = get_attribute(reader, "value");
 
 #if BYTE_ORDER == BIG_ENDIAN
 # define BYTE_ORDER_VALUE_ATTR_NAME "be_value"

Modified: MacRuby/trunk/objc.m
===================================================================
--- MacRuby/trunk/objc.m	2008-11-25 00:06:41 UTC (rev 755)
+++ MacRuby/trunk/objc.m	2008-11-25 03:13:55 UTC (rev 756)
@@ -2780,6 +2780,26 @@
     if (!ok) {
 	rb_raise(rb_eRuntimeError, "%s", error);
     }
+#if defined(__LP64__)
+# if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
+    /* XXX work around for <rdar://problem/6399046> NSNotFound 64-bit value is incorrect
+     * XXX we should introduce the possibility to write prelude scripts per
+     * frameworks where this kind of changes could be located.
+     */
+    static bool nsnotfound_fixed = false;
+    if (!nsnotfound_fixed) {
+	ID nsnotfound = rb_intern("NSNotFound");
+	VALUE val = 
+	    (VALUE)CFDictionaryGetValue(rb_cObject_dict, (void *)nsnotfound);
+	if ((VALUE)val == INT2FIX(-1)) {
+	    CFDictionarySetValue(rb_cObject_dict, 
+		    (const void *)nsnotfound,
+		    (const void *)ULL2NUM(NSNotFound));
+	    nsnotfound_fixed = true;
+	}
+    }
+# endif
+#endif
 }
 
 static VALUE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20081124/a4e8e275/attachment.html>


More information about the macruby-changes mailing list