Skip to content

Commit

Permalink
Merge pull request #363 from qmfrederik/fixes/mingw-clang-build
Browse files Browse the repository at this point in the history
MinGW: Add dllimport/dllexport attributes when compiling with clang
  • Loading branch information
rfm authored Feb 6, 2024
2 parents 79a1a6b + c1d982a commit fa96665
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Headers/GNUstepBase/GSVersionMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,10 @@ static inline void gs_consumed(id NS_CONSUMED GS_UNUSED_ARG o) { return; }
#if defined(GNUSTEP_WITH_DLL)

#if BUILD_libgnustep_base_DLL
# if defined(__MINGW__)
/* On Mingw, the compiler will export all symbols automatically, so
* __declspec(dllexport) is not needed.
# if defined(__MINGW__) && !defined(__clang__)
/* On Mingw, the GCC compiler will export all symbols automatically, so
* __declspec(dllexport) is not needed. Clang uses the more standard behavior,
* requiring you to add add a dllimport/dllexport attribute.
*/
# define GS_EXPORT_CLASS
# define GS_EXPORT extern
Expand All @@ -396,8 +397,8 @@ static inline void gs_consumed(id NS_CONSUMED GS_UNUSED_ARG o) { return; }
# define GS_DECLARE __declspec(dllexport)
# endif
#else
# if defined(__MINGW__)
/* MinGW does not need dllimport on ObjC classes and produces warnings. */
# if defined(__MINGW__) && !defined(__clang__)
/* On MinGW, the GCC compiler does not need dllimport on ObjC classes and produces warnings. */
# define GS_EXPORT_CLASS
# else
# define GS_EXPORT_CLASS __declspec(dllimport)
Expand Down

0 comments on commit fa96665

Please sign in to comment.