فهرست منبع

修复linux导出头

xx 2 سال پیش
والد
کامیت
d210132d74
2فایلهای تغییر یافته به همراه7 افزوده شده و 3 حذف شده
  1. 1 1
      src/core/entry.cpp
  2. 6 2
      src/core/entry.h

+ 1 - 1
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)

+ 6 - 2
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);
 }