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

source_changes at macosforge.org source_changes at macosforge.org
Thu Oct 15 18:23:46 PDT 2009


Revision: 2822
          http://trac.macosforge.org/projects/ruby/changeset/2822
Author:   lsansonetti at apple.com
Date:     2009-10-15 18:23:45 -0700 (Thu, 15 Oct 2009)
Log Message:
-----------
for a given CF type signature, also register an equivalent without the '=' character to conform to BridgeSupport APIs returning this type by reference

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

Modified: MacRuby/trunk/bridgesupport.cpp
===================================================================
--- MacRuby/trunk/bridgesupport.cpp	2009-10-16 01:22:43 UTC (rev 2821)
+++ MacRuby/trunk/bridgesupport.cpp	2009-10-16 01:23:45 UTC (rev 2822)
@@ -1035,7 +1035,16 @@
 	    std::map<std::string, bs_element_cftype_t *>::iterator
 		iter = bs_cftypes.find(bs_cftype->type);
 	    if (iter == bs_cftypes.end()) {
-		bs_cftypes[bs_cftype->type] = bs_cftype;
+		std::string s(bs_cftype->type);
+		bs_cftypes[s] = bs_cftype;
+		if (s.compare(s.size() - 2, 2, "=}") == 0) {
+		    // For ^{__CFError=}, also registering ^{__CFError}.
+		    // This is because functions or methods returning CF types
+		    // by reference strangely omit the '=' character as part
+		    // of their BridgeSupport signature.
+		    s.replace(s.size() - 2, 2, "}");
+		    bs_cftypes[s] = bs_cftype;
+		}
 		do_not_free = true;
 	    }
 	    else {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091015/48609421/attachment.html>


More information about the macruby-changes mailing list