[macruby-changes] [2248] MacRuby/trunk/bridgesupport.cpp

source_changes at macosforge.org source_changes at macosforge.org
Thu Aug 6 15:38:34 PDT 2009


Revision: 2248
          http://trac.macosforge.org/projects/ruby/changeset/2248
Author:   lsansonetti at apple.com
Date:     2009-08-06 15:38:33 -0700 (Thu, 06 Aug 2009)
Log Message:
-----------
re-enabled the NSNotFound 64-bit fix

Modified Paths:
--------------
    MacRuby/trunk/bridgesupport.cpp

Modified: MacRuby/trunk/bridgesupport.cpp
===================================================================
--- MacRuby/trunk/bridgesupport.cpp	2009-08-06 21:51:18 UTC (rev 2247)
+++ MacRuby/trunk/bridgesupport.cpp	2009-08-06 22:38:33 UTC (rev 2248)
@@ -1063,8 +1063,6 @@
 RoxorCore::load_bridge_support(const char *path, const char *framework_path,
 	int options)
 {
-    char *error;
-    bool ok;
     CFMutableDictionaryRef rb_cObject_dict;  
 
     if (bs_parser == NULL) {
@@ -1074,32 +1072,28 @@
     rb_cObject_dict = rb_class_ivar_dict(rb_cObject);
     assert(rb_cObject_dict != NULL);
 
-    ok = bs_parser_parse(bs_parser, path, framework_path,
-	    (bs_parse_options_t)options,
-	    __bs_parse_cb, rb_cObject_dict, &error);
+    char *error = NULL;
+    const bool ok = bs_parser_parse(bs_parser, path, framework_path,
+	    (bs_parse_options_t)options, __bs_parse_cb, rb_cObject_dict, &error);
     if (!ok) {
 	rb_raise(rb_eRuntimeError, "%s", error);
     }
-#if 0 //TODO //MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
-    /* XXX we should introduce the possibility to write prelude scripts per
-     * frameworks where this kind of changes could be located.
-     */
 #if defined(__LP64__)
     static bool R6399046_fixed = false;
-    /* XXX work around for <rdar://problem/6399046> NSNotFound 64-bit value is incorrect */
+    // XXX work around for
+    // <rdar://problem/6399046> NSNotFound 64-bit value is incorrect
     if (!R6399046_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));
+	const void *key = (const void *)rb_intern("NSNotFound");
+	const void *real_val = (const void *)ULL2NUM(LONG_MAX);
+
+	const void *val = CFDictionaryGetValue(rb_cObject_dict, key);
+	if (val != real_val) {
+	    CFDictionarySetValue(rb_cObject_dict, key, real_val);
 	    R6399046_fixed = true;
-	    DLOG("XXX", "applied work-around for rdar://problem/6399046");
 	}
     }
 #endif
+#if 0
     static bool R6401816_fixed = false;
     /* XXX work around for <rdar://problem/6401816> -[NSObject performSelector:withObject:] has wrong sel_of_type attributes*/
     if (!R6401816_fixed) {
@@ -1114,7 +1108,6 @@
 		    && arg->sel_of_type[0] != '@') {
 		    arg->sel_of_type[0] = '@';
 		    R6401816_fixed = true;
-		    DLOG("XXX", "applied work-around for rdar://problem/6401816");
 		    break;
 		}
 		arg++;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090806/f00d0b80/attachment-0001.html>


More information about the macruby-changes mailing list