[macruby-changes] [1732] MacRuby/branches/experimental/bridgesupport.cpp

source_changes at macosforge.org source_changes at macosforge.org
Thu Jun 4 17:02:55 PDT 2009


Revision: 1732
          http://trac.macosforge.org/projects/ruby/changeset/1732
Author:   lsansonetti at apple.com
Date:     2009-06-04 17:02:55 -0700 (Thu, 04 Jun 2009)
Log Message:
-----------
fixed FFI type handling (since Symbol#to_str does not exist anymore)

Modified Paths:
--------------
    MacRuby/branches/experimental/bridgesupport.cpp

Modified: MacRuby/branches/experimental/bridgesupport.cpp
===================================================================
--- MacRuby/branches/experimental/bridgesupport.cpp	2009-06-05 00:02:14 UTC (rev 1731)
+++ MacRuby/branches/experimental/bridgesupport.cpp	2009-06-05 00:02:55 UTC (rev 1732)
@@ -507,7 +507,6 @@
     rb_scan_args(argc, argv, "11", &type, &len);
     const size_t rlen = NIL_P(len) ? 1 : FIX2LONG(len);
 
-    StringValuePtr(type);
     const char *type_str = convert_ffi_type(type, false);
 
     rb_vm_pointer_t *ptr = (rb_vm_pointer_t *)xmalloc(sizeof(rb_vm_pointer_t));
@@ -964,7 +963,10 @@
 static const char *
 convert_ffi_type(VALUE type, bool raise_exception_if_unknown)
 {
-    const char *typestr = StringValueCStr(type);
+    const char *typestr = TYPE(type) == T_SYMBOL
+	? rb_sym2name(type)
+	: StringValueCStr(type);
+
     assert(typestr != NULL);
 
     // Ruby-FFI types.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090604/8102c589/attachment.html>


More information about the macruby-changes mailing list