X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Flibardour_visibility.h;h=dde3f1d11bedc6e1c3a6edf522205d34e3e92f03;hb=faefc3ba9a42417b133235e0a9efeaba467aad5f;hp=ae07961ef36454d549a0f6bbef2e83cb019f9895;hpb=e2e057ce598f82a8d47fdb1bc498cd2a6408704b;p=ardour.git diff --git a/libs/ardour/ardour/libardour_visibility.h b/libs/ardour/ardour/libardour_visibility.h index ae07961ef3..dde3f1d11b 100644 --- a/libs/ardour/ardour/libardour_visibility.h +++ b/libs/ardour/ardour/libardour_visibility.h @@ -20,39 +20,26 @@ #ifndef __libardour_libardour_visibility_h__ #define __libardour_libardour_visibility_h__ -/* _WIN32 is defined by most compilers targetting Windows, but within the - * ardour source tree, we also define COMPILER_MSVC or COMPILER_MINGW depending - * on how a Windows build is built. - */ - -#if defined _WIN32 || defined __CYGWIN__ || defined(COMPILER_MSVC) || defined(COMPILER_MINGW) +#if defined(COMPILER_MSVC) #define LIBARDOUR_DLL_IMPORT __declspec(dllimport) #define LIBARDOUR_DLL_EXPORT __declspec(dllexport) #define LIBARDOUR_DLL_LOCAL #else - #if __GNUC__ >= 4 - #define LIBARDOUR_DLL_IMPORT __attribute__ ((visibility ("default"))) - #define LIBARDOUR_DLL_EXPORT __attribute__ ((visibility ("default"))) - #define LIBARDOUR_DLL_LOCAL __attribute__ ((visibility ("hidden"))) - #else - #define LIBARDOUR_DLL_IMPORT - #define LIBARDOUR_DLL_EXPORT - #define LIBARDOUR_DLL_LOCAL - #define LIBARDOUR_DLL_IMPORT_CLASS - #define LIBARDOUR_DLL_EXPORT_CLASS - #endif + #define LIBARDOUR_DLL_IMPORT __attribute__ ((visibility ("default"))) + #define LIBARDOUR_DLL_EXPORT __attribute__ ((visibility ("default"))) + #define LIBARDOUR_DLL_LOCAL __attribute__ ((visibility ("hidden"))) #endif -#ifdef LIBARDOUR_DLL // libardour is a DLL -#ifdef LIBARDOUR_DLL_EXPORTS // defined if we are building the libardour DLL (instead of using it) - #define LIBARDOUR_API LIBARDOUR_DLL_EXPORT -#else - #define LIBARDOUR_API LIBARDOUR_DLL_IMPORT -#endif -#define LIBARDOUR_LOCAL LIBARDOUR_DLL_LOCAL -#else /* static lib, not DLL */ +#ifdef LIBARDOUR_STATIC // libardour is not a DLL #define LIBARDOUR_API #define LIBARDOUR_LOCAL +#else + #ifdef LIBARDOUR_DLL_EXPORTS // defined if we are building the libardour DLL (instead of using it) + #define LIBARDOUR_API LIBARDOUR_DLL_EXPORT + #else + #define LIBARDOUR_API LIBARDOUR_DLL_IMPORT + #endif + #define LIBARDOUR_LOCAL LIBARDOUR_DLL_LOCAL #endif #endif /* __libardour_libardour_visibility_h__ */