更新符号导出相关宏定义

This commit is contained in:
MistEO
2021-08-05 12:02:07 +08:00
parent 44db16b80a
commit 2de30dda5e
3 changed files with 36 additions and 2 deletions

View File

@@ -8,7 +8,7 @@ extern "C" {
namespace asst {
class Assistance;
}
typedef void (MEO_STDCALL *AsstCallback)(int msg, const char* detail_json, void* custom_arg);
typedef void (MEO_CALL *AsstCallback)(int msg, const char* detail_json, void* custom_arg);
MEOAPI_PORT asst::Assistance* AsstCreate();
MEOAPI_PORT asst::Assistance* AsstCreateEx(AsstCallback callback, void* custom_arg);

View File

@@ -1,5 +1,14 @@
#pragma once
// The way how the function is called
#if !defined(MEO_CALL)
#if defined(_WIN32)
#define MEO_CALL __stdcall
#else
#define ISSCALL
#endif /* _WIN32 */
#endif /* ISSCALL */
// The function exported symbols
#if defined _WIN32 || defined __CYGWIN__
#define MEO_DLL_IMPORT __declspec(dllimport)
@@ -23,4 +32,6 @@
#define MEOAPI_PORT MEO_DLL_IMPORT
#endif // MEO_DLL_EXPORTS
#define MEO_STDCALL _stdcall
#define MEOAPI MEOAPI_PORT MEO_CALL
#define MEOLOCAL MEO_DLL_LOCAL MEO_CALL

View File

@@ -6,6 +6,29 @@
#include <string.h>
#if 0
#if _MSC_VER
// Win32平台下Dll的入口
BOOL APIENTRY DllMain(HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
) {
UNREFERENCED_PARAMETER(hModule);
UNREFERENCED_PARAMETER(lpReserved);
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
#elif VA_GNUC
#endif
#endif
AsstCallback _callback = nullptr;
void CallbackTrans(asst::TaskMsg msg, const json::value& json, void* custom_arg)