Skip to content

Commit

Permalink
use __declspec for visibility on mingw
Browse files Browse the repository at this point in the history
  • Loading branch information
recp committed Oct 30, 2021
1 parent 81be331 commit e8ce20d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions include/ds/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit e8ce20d

Please sign in to comment.