Fix up build with mruby binding
This commit is contained in:
parent
b5e5a26d8b
commit
39ac6aecf0
6 changed files with 28 additions and 19 deletions
|
@ -596,7 +596,7 @@ fileBindingInit(mrb_state *mrb)
|
|||
mrb_define_method(mrb, klass, "path", fileGetPath, MRB_ARGS_NONE());
|
||||
|
||||
/* FileTest */
|
||||
RClass *module = mrb_define_module(mrb, "FileTest");
|
||||
RClass *module = mrb_define_module(mrb, "MKXPFileTest");
|
||||
mrb_define_module_function(mrb, module, "exist?", fileTestDoesExist, MRB_ARGS_REQ(1));
|
||||
mrb_define_module_function(mrb, module, "directory?", fileTestIsDirectory, MRB_ARGS_REQ(1));
|
||||
mrb_define_module_function(mrb, module, "file?", fileTestIsFile, MRB_ARGS_REQ(1));
|
||||
|
|
|
@ -172,7 +172,7 @@ MRB_FUNCTION(kernelLoadData)
|
|||
mrb_get_args(mrb, "z", &filename);
|
||||
|
||||
SDL_RWops ops;
|
||||
GUARD_EXC( shState->fileSystem().openRead(ops, filename); )
|
||||
GUARD_EXC( shState->fileSystem().openReadRaw(ops, filename); )
|
||||
|
||||
mrb_value obj;
|
||||
try { obj = marshalLoadInt(mrb, &ops); }
|
||||
|
|
|
@ -473,8 +473,8 @@ read_value(MarshalContext *ctx)
|
|||
mrb_state *mrb = ctx->mrb;
|
||||
int8_t type = ctx->readByte();
|
||||
mrb_value value;
|
||||
if (mrb->arena_idx > maxArena)
|
||||
maxArena = mrb->arena_idx;
|
||||
if (mrb->gc.arena_idx > maxArena)
|
||||
maxArena = mrb->gc.arena_idx;
|
||||
|
||||
int arena = mrb_gc_arena_save(mrb);
|
||||
|
||||
|
@ -676,7 +676,7 @@ static void
|
|||
write_array(MarshalContext *ctx, mrb_value array)
|
||||
{
|
||||
mrb_state *mrb = ctx->mrb;
|
||||
int len = mrb_ary_len(mrb, array);
|
||||
int len = RARRAY_LEN(array);
|
||||
write_fixnum(ctx, len);
|
||||
|
||||
int i;
|
||||
|
@ -687,8 +687,6 @@ write_array(MarshalContext *ctx, mrb_value array)
|
|||
}
|
||||
}
|
||||
|
||||
KHASH_DECLARE(ht, mrb_value, mrb_value, 1)
|
||||
|
||||
static void
|
||||
write_hash(MarshalContext *ctx, mrb_value hash)
|
||||
{
|
||||
|
@ -707,7 +705,7 @@ write_hash(MarshalContext *ctx, mrb_value hash)
|
|||
continue;
|
||||
|
||||
write_value(ctx, kh_key(h, k));
|
||||
write_value(ctx, kh_val(h, k));
|
||||
write_value(ctx, kh_val(h, k).v);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -732,7 +730,7 @@ write_object(MarshalContext *ctx, mrb_value object)
|
|||
write_value(ctx, mrb_str_intern(mrb, path));
|
||||
|
||||
mrb_value iv_ary = mrb_obj_instance_variables(mrb, object);
|
||||
int iv_count = mrb_ary_len(mrb, iv_ary);
|
||||
int iv_count = RARRAY_LEN(iv_ary);
|
||||
write_fixnum(ctx, iv_count);
|
||||
|
||||
int i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue