🔥 move NASAL_EXPORT to nasal.h

This commit is contained in:
ValKmjolnir 2024-12-11 20:52:58 +08:00
parent 1b745ad176
commit dea19fe3c3
7 changed files with 13 additions and 20 deletions

View File

@ -124,7 +124,7 @@ module_func_info func_tbl[] = {
}
NASAL_EXTERN module_func_info* get() {
NASAL_EXPORT module_func_info* get() {
return fib_module::func_tbl;
}

View File

@ -111,7 +111,7 @@ module_func_info func_tbl[] = {
{nullptr, nullptr}
};
NASAL_EXTERN module_func_info* get() {
NASAL_EXPORT module_func_info* get() {
return func_tbl;
}

View File

@ -295,7 +295,7 @@ module_func_info func_tbl[] = {
{nullptr, nullptr}
};
NASAL_EXTERN module_func_info* get() {
NASAL_EXPORT module_func_info* get() {
return func_tbl;
}

View File

@ -262,7 +262,7 @@ module_func_info func_tbl[] = {
{nullptr, nullptr}
};
NASAL_EXTERN module_func_info* get() {
NASAL_EXPORT module_func_info* get() {
return func_tbl;
}

View File

@ -1,7 +1,7 @@
#pragma once
#ifndef __nasver__
#define __nasver__ "11.3"
#define __nasver__ "11.3.1"
#endif
#include <cstddef>
@ -19,3 +19,11 @@ using f64 = double;
// virtual machine stack depth, both global depth and value stack depth
const u32 VM_STACK_DEPTH = UINT16_MAX;
// avoid error loading function bug in MSVC version nasal.exe
#ifdef _MSC_VER
// and fuck MSVC again
#define NASAL_EXPORT extern "C" __declspec(dllexport)
#else
#define NASAL_EXPORT extern "C" __attribute__((visibility("default")))
#endif

View File

@ -126,13 +126,4 @@ struct module_func_info {
// module function "get" type
typedef module_func_info* (*get_func_ptr)();
// avoid error loading function bug in MSVC version nasal.exe
#ifdef _MSC_VER
// and fuck MSVC again
#define NASAL_EXTERN extern "C" __declspec(dllexport)
#else
#define NASAL_EXTERN extern "C"
#endif
}

View File

@ -3,12 +3,6 @@
#include "nasal.h"
#ifdef _WIN32
#define NASAL_EXPORT __declspec(dllexport)
#else
#define NASAL_EXPORT __attribute__((visibility("default")))
#endif
#ifdef __cplusplus
extern "C" {
#endif