(chibi weak) library is a noop when not compiling with weak references.

This commit is contained in:
Alex Shinn 2015-06-14 15:27:21 +09:00
parent 19df6e7578
commit 4527c772c5

View file

@ -60,6 +60,7 @@ sexp sexp_init_library (sexp ctx, sexp self, sexp_sint_t n, sexp env, const char
return SEXP_ABI_ERROR; return SEXP_ABI_ERROR;
sexp_gc_preserve3(ctx, name, t, op); sexp_gc_preserve3(ctx, name, t, op);
#if SEXP_USE_WEAK_REFERENCES
t = sexp_make_fixnum(SEXP_EPHEMERON); t = sexp_make_fixnum(SEXP_EPHEMERON);
op = sexp_make_type_predicate(ctx, name=sexp_c_string(ctx,"ephemeron?",-1), t); op = sexp_make_type_predicate(ctx, name=sexp_c_string(ctx,"ephemeron?",-1), t);
sexp_env_define(ctx, env, name=sexp_intern(ctx, "ephemeron?", -1), op); sexp_env_define(ctx, env, name=sexp_intern(ctx, "ephemeron?", -1), op);
@ -76,6 +77,7 @@ sexp sexp_init_library (sexp ctx, sexp self, sexp_sint_t n, sexp env, const char
sexp_opcode_return_type(op) = sexp_make_fixnum(SEXP_OBJECT); sexp_opcode_return_type(op) = sexp_make_fixnum(SEXP_OBJECT);
sexp_opcode_arg1_type(op) = sexp_make_fixnum(SEXP_EPHEMERON); sexp_opcode_arg1_type(op) = sexp_make_fixnum(SEXP_EPHEMERON);
} }
#endif
#if 0 #if 0
name = sexp_c_string(ctx, "Weak-Vector", -1); name = sexp_c_string(ctx, "Weak-Vector", -1);