🐛 fix bug that `dylib.dlopen` cannot load dynamic lib in local dir.
This commit is contained in:
parent
854850d9b1
commit
c0862704f0
|
@ -112,14 +112,14 @@ You could create project in `Visual Studio` by this way: [__CLICK__](./doc/vs.md
|
|||
First we should learn how to write and run a program using this language,
|
||||
click to see the [__tutorial__](#tutorial).
|
||||
|
||||
Use this get version of interpreter:
|
||||
|
||||
> ./nasal
|
||||
|
||||
Input this command to run scripts __directly__:
|
||||
|
||||
> ./nasal filename
|
||||
|
||||
Use these commands to get version of interpreter:
|
||||
|
||||
> ./nasal -v | --version
|
||||
|
||||
Use these commands to get help(see more debug commands in help):
|
||||
|
||||
> ./nasal -h | --help
|
||||
|
|
|
@ -98,21 +98,17 @@ __`linux/macOS/Unix`__ 平台直接使用make即可:
|
|||
|
||||
首先我们要通过[__教程__](#教程)知道这个语言的语法以及如何使用这个解释器来运行nasal程序。
|
||||
|
||||
使用这个命令查看解释器的版本:
|
||||
|
||||
> ./nasal
|
||||
|
||||
输入下面的命令来 __直接__ 执行:
|
||||
|
||||
> ./nasal filename
|
||||
|
||||
下面两个命令可以用于查看解释器的版本:
|
||||
|
||||
> ./nasal -v
|
||||
>
|
||||
> ./nasal --version
|
||||
|
||||
下面两个命令可以用于查看帮助(调试器的使用方法可以进入调试模式之后根据提示来查询):
|
||||
|
||||
> ./nasal -h
|
||||
>
|
||||
> ./nasal --help
|
||||
> ./nasal -h | --help
|
||||
|
||||
如果你的操作系统是 __`Windows`__ 并且你想输出unicode,请保证你的控制台程序的代码页支持utf-8,若不支持,使用下面这个命令启用代码页:
|
||||
|
||||
|
|
1
lib.nas
1
lib.nas
|
@ -428,6 +428,7 @@ var dylib=
|
|||
# open dynamic lib.
|
||||
dlopen: func(libname){
|
||||
# find dynamic lib from local dir first
|
||||
libname=(os.platform()=="windows"?".\\":"./")~libname;
|
||||
if(io.exists(libname))
|
||||
return __dlopen(libname);
|
||||
# find dynamic lib through PATH
|
||||
|
|
|
@ -428,6 +428,7 @@ var dylib=
|
|||
# open dynamic lib.
|
||||
dlopen: func(libname){
|
||||
# find dynamic lib from local dir first
|
||||
libname=(os.platform()=="windows"?".\\":"./")~libname;
|
||||
if(io.exists(libname))
|
||||
return __dlopen(libname);
|
||||
# find dynamic lib through PATH
|
||||
|
|
Loading…
Reference in New Issue