From d1ea6131d01806b66a9a7fd75bd01df16605b805 Mon Sep 17 00:00:00 2001 From: xx Date: Tue, 28 May 2024 18:31:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dlinux=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/entry.cpp | 2 +- src/core/entry.h | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/core/entry.cpp b/src/core/entry.cpp index 1edac33..a0c9537 100644 --- a/src/core/entry.cpp +++ b/src/core/entry.cpp @@ -4,7 +4,7 @@ #include "core/define.h" #include "core/config.h" extern "C" { - __declspec(dllexport) int fastweb(const char* config_filepath) + int fastweb(const char* config_filepath) { std::cout << "=========== [fastweb engine] ============" << std::endl; if (sConfig->open(config_filepath) == false) diff --git a/src/core/entry.h b/src/core/entry.h index d00a4b2..152bdde 100644 --- a/src/core/entry.h +++ b/src/core/entry.h @@ -1,5 +1,9 @@ - +#if defined(_WIN32) || defined(_WIN64) +#define DLL_EXPORT __declspec(dllexport) +#else +#define DLL_EXPORT __attribute__((visibility("default"))) +#endif extern "C" { - __declspec(dllexport) int fastweb(const char* config_filepath); + DLL_EXPORT int fastweb(const char* config_filepath); } \ No newline at end of file