dllexport ASSIMP_API in all Windows compilers, not just MSVC

This fixes a problem mentioned in issue #2685 where the libassimp.dll
compiled with MinGW doesn't export any symbols.
pull/2698/head
Robikz 2019-10-06 18:46:35 +02:00
parent d2476e9cda
commit 81d125a2cc
1 changed files with 13 additions and 8 deletions

View File

@ -126,16 +126,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* GENBOUNDINGBOXES */ * GENBOUNDINGBOXES */
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER #ifdef _WIN32
# undef ASSIMP_API # undef ASSIMP_API
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */ /* Define 'ASSIMP_BUILD_DLL_EXPORT' to build a DLL of the library */
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
# ifdef ASSIMP_BUILD_DLL_EXPORT # ifdef ASSIMP_BUILD_DLL_EXPORT
# define ASSIMP_API __declspec(dllexport) # define ASSIMP_API __declspec(dllexport)
# define ASSIMP_API_WINONLY __declspec(dllexport) # define ASSIMP_API_WINONLY __declspec(dllexport)
# pragma warning (disable : 4251)
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in /* Define 'ASSIMP_DLL' before including Assimp to link to ASSIMP in
@ -148,7 +146,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# define ASSIMP_API # define ASSIMP_API
# define ASSIMP_API_WINONLY # define ASSIMP_API_WINONLY
# endif # endif
#elif defined(SWIG)
/* Do nothing, the relevant defines are all in AssimpSwigPort.i */
#else
# define ASSIMP_API __attribute__ ((visibility("default")))
# define ASSIMP_API_WINONLY
#endif
#ifdef _MSC_VER
# ifdef ASSIMP_BUILD_DLL_EXPORT
# pragma warning (disable : 4251)
# endif
/* Force the compiler to inline a function, if possible /* Force the compiler to inline a function, if possible
*/ */
# define AI_FORCE_INLINE __forceinline # define AI_FORCE_INLINE __forceinline
@ -156,17 +166,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Tells the compiler that a function never returns. Used in code analysis /* Tells the compiler that a function never returns. Used in code analysis
* to skip dead paths (e.g. after an assertion evaluated to false). */ * to skip dead paths (e.g. after an assertion evaluated to false). */
# define AI_WONT_RETURN __declspec(noreturn) # define AI_WONT_RETURN __declspec(noreturn)
#elif defined(SWIG) #elif defined(SWIG)
/* Do nothing, the relevant defines are all in AssimpSwigPort.i */ /* Do nothing, the relevant defines are all in AssimpSwigPort.i */
#else #else
# define AI_WONT_RETURN # define AI_WONT_RETURN
# define ASSIMP_API __attribute__ ((visibility("default")))
# define ASSIMP_API_WINONLY
# define AI_FORCE_INLINE inline # define AI_FORCE_INLINE inline
#endif // (defined _MSC_VER) #endif // (defined _MSC_VER)