win32dll.h 549 B

12345678910111213141516171819202122
  1. #ifndef __WIN32_DLL_20180622__
  2. #define __WIN32_DLL_20180622__
  3. #ifdef WIN32DLL_EXPORTS
  4. #define MYDLL_API _declspec(dllexport) // 导出dll函数,供外部使用;
  5. #else
  6. #define MYDLL_API _declspec(dllimport) // 导出dll函数,供dll内部使用;
  7. #endif // NONMFCDLL_EXPORTS
  8. #ifdef __cplusplus
  9. extern "C"
  10. {
  11. #endif
  12. MYDLL_API int add(int a, int b); // 缺省调用约定:__cdecl(项目本身调用约定)
  13. MYDLL_API int add2(int a, int b); // 缺省调用约定:__cdecl(项目本身调用约定)
  14. MYDLL_API int g_result;
  15. #ifdef __cplusplus
  16. };
  17. #endif
  18. #endif //__WIN32_DLL_20180622__