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:
		| @@ -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; | ||||
| } | ||||
|   | ||||
| @@ -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); | ||||
|   | ||||
| @@ -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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Calvin Rose
					Calvin Rose