From e8ce20d73263ed1fe89fcfd882d219b112ed9956 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Sat, 30 Oct 2021 10:46:26 +0300 Subject: [PATCH] use __declspec for visibility on mingw --- include/ds/common.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/ds/common.h b/include/ds/common.h index f762933..8bc8c73 100644 --- a/include/ds/common.h +++ b/include/ds/common.h @@ -6,7 +6,7 @@ #ifndef common_h #define common_h -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__) # ifdef DS_STATIC # define DS_EXPORT # elif defined(DS_EXPORTS) @@ -15,11 +15,15 @@ # define DS_EXPORT __declspec(dllimport) # endif # define DS_HIDE -# define DS_INLINE __forceinline -# define DS_ALIGN(X) __declspec(align(X)) #else # define DS_EXPORT __attribute__((visibility("default"))) # define DS_HIDE __attribute__((visibility("hidden"))) +#endif + +#if defined(_MSC_VER) +# define DS_INLINE __forceinline +# define DS_ALIGN(X) __declspec(align(X)) +#else # define DS_INLINE inline __attribute((always_inline)) # define DS_ALIGN(X) __attribute((aligned(X))) #endif