Skip to content

Commit

Permalink
fixed FFI type handling (since Symbol#to_str does not exist anymore)
Browse files Browse the repository at this point in the history
  • Loading branch information
lrz committed Jun 5, 2009
1 parent bbfe8ed commit ffd71a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bridgesupport.cpp
Expand Up @@ -507,7 +507,6 @@ rb_pointer_new(VALUE rcv, SEL sel, int argc, VALUE *argv)
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));
Expand Down Expand Up @@ -964,7 +963,10 @@ Init_BridgeSupport(void)
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.
Expand Down

0 comments on commit ffd71a1

Please sign in to comment.