diff --git a/include/api/types.h b/include/api/types.h index 5dc2dfb6451..77f200bda5c 100644 --- a/include/api/types.h +++ b/include/api/types.h @@ -25,11 +25,17 @@ #include "include/api/dual_abi_helper.h" #include "include/api/format.h" +#ifndef MS_API #ifdef _WIN32 +#ifdef BUILDING_DLL #define MS_API __declspec(dllexport) #else +#define MS_API __declspec(dllimport) +#endif +#else #define MS_API __attribute__((visibility("default"))) #endif +#endif namespace mindspore { enum ModelType : uint32_t {