(srfi 39) now works without threads

This commit is contained in:
Alex Shinn 2011-12-09 21:15:57 +09:00
parent bafab6e49d
commit 9499258d9a
2 changed files with 10 additions and 1 deletions

View file

@ -3,4 +3,8 @@
(export make-parameter parameterize)
(import (scheme))
(include-shared "39/param")
(include "39/syntax.scm"))
(cond-expand
(threads
(include "39/syntax.scm"))
(else
(include "39/syntax-no-threads.scm"))))

View file

@ -26,6 +26,7 @@ static sexp sexp_parameter_converter (sexp ctx, sexp self, sexp_sint_t n, sexp p
return res ? res : SEXP_FALSE;
}
#if SEXP_USE_GREEN_THREADS
static sexp sexp_thread_parameters (sexp ctx, sexp self, sexp_sint_t n) {
sexp res = sexp_context_params(ctx);
return res ? res : SEXP_NULL;
@ -35,6 +36,7 @@ static sexp sexp_thread_parameters_set (sexp ctx, sexp self, sexp_sint_t n, sexp
sexp_context_params(ctx) = new;
return SEXP_VOID;
}
#endif
sexp sexp_init_library (sexp ctx, sexp self, sexp_sint_t n, sexp env, const char* version, sexp_abi_identifier_t abi) {
if (!(sexp_version_compatible(ctx, version, sexp_version)
@ -43,8 +45,11 @@ sexp sexp_init_library (sexp ctx, sexp self, sexp_sint_t n, sexp env, const char
sexp_define_foreign(ctx, env, "%make-parameter", 2, sexp_make_parameter);
sexp_define_foreign(ctx, env, "parameter-converter", 1, sexp_parameter_converter);
#if SEXP_USE_GREEN_THREADS
sexp_define_foreign(ctx, env, "thread-parameters", 0, sexp_thread_parameters);
sexp_define_foreign(ctx, env, "thread-parameters-set!", 1, sexp_thread_parameters_set);
#endif
return SEXP_VOID;
}