From e897725c711c49fb3384098d90425a9795739f90 Mon Sep 17 00:00:00 2001 From: lixian Date: Sat, 30 Jan 2021 10:25:23 +0800 Subject: [PATCH] fix windows visibility --- include/api/types.h | 17 ++--------------- mindspore/lite/include/ms_tensor.h | 16 ++-------------- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/include/api/types.h b/include/api/types.h index eb0398f905..0f4503e122 100644 --- a/include/api/types.h +++ b/include/api/types.h @@ -22,21 +22,8 @@ #include #include "include/api/data_type.h" -// refer to https://gcc.gnu.org/wiki/Visibility -#if defined _WIN32 || defined __CYGWIN__ -#ifdef BUILDING_DLL -#ifdef __GNUC__ -#define MS_API __attribute__((dllexport)) -#else -#define MS_API __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. -#endif -#else -#ifdef __GNUC__ -#define MS_API __attribute__((dllimport)) -#else -#define MS_API __declspec(dllimport) // Note: actually gcc seems to also supports this syntax. -#endif -#endif +#ifdef _WIN32 +#define MS_API __declspec(dllexport) #else #define MS_API __attribute__((visibility("default"))) #endif diff --git a/mindspore/lite/include/ms_tensor.h b/mindspore/lite/include/ms_tensor.h index 486690589c..f3706af095 100644 --- a/mindspore/lite/include/ms_tensor.h +++ b/mindspore/lite/include/ms_tensor.h @@ -25,20 +25,8 @@ #include "ir/dtype/type_id.h" #ifndef MS_API -#if defined _WIN32 || defined __CYGWIN__ -#ifdef BUILDING_DLL -#ifdef __GNUC__ -#define MS_API __attribute__((dllexport)) -#else -#define MS_API __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. -#endif -#else -#ifdef __GNUC__ -#define MS_API __attribute__((dllimport)) -#else -#define MS_API __declspec(dllimport) // Note: actually gcc seems to also supports this syntax. -#endif -#endif +#ifdef _WIN32 +#define MS_API __declspec(dllexport) #else #define MS_API __attribute__((visibility("default"))) #endif