From 64d92fbade9e54ba8bb334b67ba541cea1f7ae9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Fri, 18 Mar 2022 04:07:25 +0100 Subject: Fix building with hidden visibility. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- libkdchart/kdchart_export.h | 48 ++++++++------------------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) (limited to 'libkdchart') diff --git a/libkdchart/kdchart_export.h b/libkdchart/kdchart_export.h index afa340f..40b72c2 100644 --- a/libkdchart/kdchart_export.h +++ b/libkdchart/kdchart_export.h @@ -1,47 +1,15 @@ #ifndef KDCHART_EXPORT_H #define KDCHART_EXPORT_H -#include - -#if 0 -#include -#else - -#if defined(Q_OS_WIN32) && defined(KDCHART_DLL) -#define DLL_EXPORT __declspec(dllexport) -#define DLL_IMPORT __declspec(dllimport) -#else -#define DLL_EXPORT -#define DLL_IMPORT -#endif - -#if defined(KDCHART_DLL) -#define KDCHART_EXPORT DLL_EXPORT +#if defined(__KDE_HAVE_GCC_VISIBILITY) || defined(G_HAVE_GCC_VISIBILITY) +#define KDCHART_NO_EXPORT __attribute__ ((visibility("hidden"))) +#define KDCHART_EXPORT __attribute__ ((visibility("default"))) +#elif defined(_WIN32) +#define KDCHART_NO_EXPORT +#define KDCHART_EXPORT __declspec(dllexport) #else -#define KDCHART_EXPORT DLL_IMPORT +#define KDCHART_NO_EXPORT +#define KDCHART_EXPORT #endif #endif - -#endif // #if 1 - -/* - How to make a KD Chart DLL rather than linking statically: - - 1. We have an #include statement in all - of our public KD Chart header files - - 2. We have the KDCHART_EXPORT macro added to all of our - public classes. - - So e.g. the class header reads: - - class KDCHART_EXPORT KDChartWidget : public QWidget - { - - } - - - 3. In order to create a DLL - just add "CONFIG += dll" to the qmake command line or to the [KD Chart directory]/src/src.pro file -*/ -- cgit v1.2.1