🐛 fix error loading bug in MSVC version

This commit is contained in:
ValKmjolnir
2023-12-02 21:48:20 +08:00
parent d42e4a5897
commit 2c03d59b6f
8 changed files with 16 additions and 7 deletions

View File

@@ -593,7 +593,7 @@ module_func_info func_tbl[] = {
// the reason why using this way to get function pointer
// is because `var` has constructors, which is not compatiable in C
// so "extern "C" var fib" may get compilation warnings
extern "C" module_func_info* get() {
NASAL_EXTERN module_func_info* get() {
return func_tbl;
}
```

View File

@@ -574,7 +574,7 @@ module_func_info func_tbl[] = {
// 之所以用这种方式来获取函数指针, 是因为`var`是有构造函数的
// 有构造函数的类型作为返回值, 和C是不兼容的, 这导致
// 类似 "extern "C" var fib" 的写法会得到编译错误
extern "C" module_func_info* get() {
NASAL_EXTERN module_func_info* get() {
return func_tbl;
}
```