Skip to content

Commit

Permalink
🔥 move NASAL_EXPORT to nasal.h
Browse files Browse the repository at this point in the history
  • Loading branch information
ValKmjolnir committed Dec 11, 2024
1 parent 1b745ad commit dea19fe
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion module/fib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion module/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion module/matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion module/nasocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
10 changes: 9 additions & 1 deletion src/nasal.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#ifndef __nasver__
#define __nasver__ "11.3"
#define __nasver__ "11.3.1"
#endif

#include <cstddef>
Expand All @@ -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
9 changes: 0 additions & 9 deletions src/nasal_gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
6 changes: 0 additions & 6 deletions src/nasal_web.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dea19fe

Please sign in to comment.