1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

fixes for rubinius

This commit is contained in:
Charles Lowell 2010-06-07 13:52:07 +03:00
parent 2b1c38b792
commit eeea845a0c
4 changed files with 33 additions and 3 deletions

View file

@ -5,7 +5,7 @@ V8SRC=build/v8
LIBV8=build/v8/libv8.a
LIBV8_G=build/v8/libv8_g.a
GCC_VERSION=$(shell ruby -e 'puts %x{gcc --version} =~ /(\d)\.(\d)\.\d/ ? $$1 + $$2 : "UNKNOWN"')
ARCH=$(shell ruby -e "puts ['foo'].pack('p').size == 8 ? 'x64' : 'ia32'")
ARCH=$(shell ruby build_cpu.rb)
all: $(LIBV8)

View file

@ -0,0 +1,31 @@
require 'rbconfig'
def x86_64_from_build_cpu
RbConfig::MAKEFILE_CONFIG['build_cpu'] == 'x86_64'
end
def x86_64_from_byte_length
['foo'].pack('p').size == 8
end
def x86_64_from_arch_flag
RbConfig::MAKEFILE_CONFIG['ARCH_FLAG'] =~ /x86_64/
end
def darwin?
RUBY_PLATFORM =~ /darwin/
end
def rubinius?
Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == "rbx"
end
def x64?
if darwin? && !rubinius?
x86_64_from_arch_flag
else
x86_64_from_build_cpu || x86_64_from_byte_length
end
end
puts x64? ? "x64" : "ia32"

View file

@ -70,7 +70,7 @@ namespace {
return rr_v82rb(args(self)->length);
}
VALUE Get(VALUE self, VALUE index) {
int i = NUM2INT(rb_to_int(index));
int i = NUM2INT(index);
return rr_v82rb(args(self)->values->Get(i));
}
VALUE Callee(VALUE self) {

View file

@ -157,7 +157,6 @@ namespace {
VALUE New(VALUE function_template) {
HandleScope handles;
rb_need_block();
VALUE code = rb_block_proc();
if (NIL_P(code)) {
return Qnil;