ruby: fix windows build warnings/load ruby.rb

develop
jj 2012-06-14 22:35:59 +02:00
parent 6bd67cc055
commit cfdf941c52
2 changed files with 4 additions and 2 deletions

@ -483,6 +483,7 @@ static VALUE rb_dfregister(VALUE self, VALUE name, VALUE descr)
static VALUE rb_dfregister(VALUE self, VALUE name, VALUE descr)
{
rb_raise(*rb_eRuntimeError, "not implemented");
return Qnil;
}
static VALUE rb_dfget_global_address(VALUE self, VALUE name)
@ -841,7 +842,8 @@ static void ruby_bind_dfhack(void) {
// load the default ruby-level definitions
int state=0;
rb_load_protect(rb_str_new2("./hack/ruby.rb"), Qfalse, &state);
// windows cmake installs files in df/, linux installs files in df/hack/
rb_eval_string_protect("File.exist?('hack/ruby.rb') ? load('hack/ruby.rb') : load('ruby.rb')", &state);
if (state)
dump_rb_error();
}

@ -1048,7 +1048,7 @@ end
end
# load autogen'd file
require 'hack/ruby-autogen'
File.exist?('hack/ruby-autogen.rb') ? require('hack/ruby-autogen') : require('ruby-autogen')
# load optional user-specified startup file
load 'ruby_custom.rb' if File.exist?('ruby_custom.rb')