1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-31 15:43:01 +00:00

Make setting up stl easier. Add shared library output to Makefile.

This commit is contained in:
Calvin Rose
2018-05-14 21:52:51 -04:00
parent 80ae7e80e6
commit c6f79eca6d
4 changed files with 36 additions and 17 deletions

View File

@@ -60,7 +60,7 @@ static const DstReg cfuns[] = {
{NULL, NULL}
};
DstTable *dst_stl_env() {
DstTable *dst_stl_env(int flags) {
static uint32_t error_asm[] = {
DOP_ERROR
};
@@ -112,7 +112,8 @@ DstTable *dst_stl_env() {
/* Run bootstrap source */
dst_dobytes(env, dst_stl_bootstrap_gen, sizeof(dst_stl_bootstrap_gen));
dst_gcunroot(dst_wrap_table(env));
if (flags & DST_STL_NOGCROOT)
dst_gcunroot(dst_wrap_table(env));
return env;
}

View File

@@ -195,7 +195,8 @@ Dst dst_env_resolve(DstTable *env, const char *name);
DstTable *dst_env_arg(DstArgs args);
/* STL */
DstTable *dst_stl_env(void);
#define DST_STL_NOGCROOT 1
DstTable *dst_stl_env(int flags);
/* C Function helpers */
int dst_arity_err(DstArgs args, int32_t n, const char *prefix);

View File

@@ -33,8 +33,7 @@ int main(int argc, char **argv) {
/* Set up VM */
dst_init();
env = dst_stl_env();
dst_gcroot(dst_wrap_table(env));
env = dst_stl_env(0);
/* Create args tuple */
args = dst_array(argc);