Fix exporting functions in library.

Rewrites definition of macro KVZ_PUBLIC in kvazaar.h so that
KVZ_STATIC_LIB need not be defined when building a static library.
This commit is contained in:
Arttu Ylä-Outinen 2015-12-21 14:38:59 +02:00
parent 8427a85d36
commit eb6fa3d980

View file

@ -34,26 +34,30 @@
extern "C" {
#endif
#if defined(KVZ_STATIC_LIB) && defined(PIC)
#undef KVZ_STATIC_LIB
#endif
#if defined(KVZ_STATIC_LIB)
// Using or building kvazaar as a static library.
#if defined(KVZ_DLL_EXPORTS)
#if !defined(PIC)
// Building static kvazaar library.
#define KVZ_PUBLIC
#elif defined(_WIN32) || defined(__CYGWIN__)
#ifdef KVZ_DLL_EXPORTS
// Building kvazaar on windows.
#elif defined(_WIN32) || defined(__CYGWIN__)
// Building kvazaar DLL on Windows.
#define KVZ_PUBLIC __declspec(dllexport)
#else
// Using kvazaar as a DLL on windows.
#define KVZ_PUBLIC __declspec(dllimport)
#endif
#elif defined(__GNUC__)
// Using GCC and not on windows.
#elif defined(__GNUC__)
// Building kvazaar shared library with GCC.
#define KVZ_PUBLIC __attribute__ ((visibility ("default")))
#else
#else
#define KVZ_PUBLIC
#endif
#else
#if defined(KVZ_STATIC_LIB)
// Using static kvazaar library.
#define KVZ_PUBLIC
#elif defined(_WIN32) || defined(__CYGWIN__)
// Using kvazaar DLL on Windows.
#define KVZ_PUBLIC __declspec(dllimport)
#else
// Using kvazaar shared library and not on Windows.
#define KVZ_PUBLIC
#endif
#endif
/**