🚀 change module loading

This commit is contained in:
ValKmjolnir
2022-11-15 21:23:34 +08:00
parent 5821c40cb4
commit 2772fa748d
15 changed files with 154 additions and 693 deletions
+1 -3
View File
@@ -428,7 +428,7 @@ var unix={
# dylib is the core hashmap for developers to load their own library.
# for safe using dynamic library, you could use 'module' in stl/module.nas
var dylib={
# open dynamic lib.
# open dynamic lib. return a hash including dl pointer and function pointers
dlopen: func(libname){
# find dynamic lib from local dir first
libname=(os.platform()=="windows"?".\\":"./")~libname;
@@ -448,8 +448,6 @@ var dylib={
}
return __dlopen(libname);
},
# load symbol from an open dynamic lib.
dlsym: func(lib,sym){return __dlsym; },
# close dynamic lib, this operation will make all the symbols loaded from it invalid.
dlclose: func(lib){return __dlclose; },
# call the loaded symbol, with infinite parameters: