我正在为第三方应用程序编写 DLL。主要软件工程师提到应用程序使用 __cdecl (/Gd) 调用约定。我需要确保我使用它。
此外,第三方向我提供了一个 C++ DLL 框架,它导出的函数如下:
#ifdef _EXPORTING
#define DECLSPEC __declspec(dllexport)
#else
#define DECLSPEC __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
DECLSPEC int ICD_Create(char* id);
....
....
我有点困惑。为什么使用 __declspec 约定而不是 __cdedl 导出函数?__declspec 是否支持 _cdecl?
谢谢。