Skip to content

Commit

Permalink
Simple hack to allow using sqlite3 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed May 12, 2010
1 parent 63bab40 commit b969740
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vm/capi/bignum.cpp
Expand Up @@ -95,4 +95,12 @@ extern "C" {
}
return d;
}

int rb_big_bytes_used(VALUE obj) {
NativeMethodEnvironment* env = NativeMethodEnvironment::get();

Bignum* big = c_as<Bignum>(env->get_object(obj));

return big->size(env->state())->to_native();
}
}
8 changes: 8 additions & 0 deletions vm/capi/ruby.h
Expand Up @@ -797,6 +797,14 @@ double rb_num2dbl(VALUE);

double rb_big2dbl(VALUE obj);

int rb_big_bytes_used(VALUE obj);
#define RBIGNUM_LEN(obj) rb_big_bytes_used(obj)

// fake out, used with RBIGNUM_LEN anyway, which provides
// the full answer
#define SIZEOF_BDIGITS 1


/** Calls this method in a superclass. */
VALUE rb_call_super(int argc, const VALUE *argv);

Expand Down

0 comments on commit b969740

Please sign in to comment.