mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 14:19:18 +02:00
(srfi 39) now works without threads
This commit is contained in:
parent
bafab6e49d
commit
9499258d9a
2 changed files with 10 additions and 1 deletions
|
@ -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"))))
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue