From cc16fd0121fe79ae1fd9539a606c19827f64bc23 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 1 Nov 2015 08:36:28 +0100 Subject: use newly-added preprocessor variable --- opentrack-compat/shm.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'opentrack-compat/shm.h') diff --git a/opentrack-compat/shm.h b/opentrack-compat/shm.h index 17a0d843..7c8a66a9 100644 --- a/opentrack-compat/shm.h +++ b/opentrack-compat/shm.h @@ -18,8 +18,15 @@ #include #include #endif +#include -class PortableLockedShm { +#ifdef BUILD_opentrack_compat +# define COMPAT_EXPORT Q_DECL_EXPORT +#else +# define COMPAT_EXPORT Q_DECL_IMPORT +#endif + +class COMPAT_EXPORT PortableLockedShm { public: PortableLockedShm(const char *shmName, const char *mutexName, int mapSize); ~PortableLockedShm(); -- cgit v1.2.3 From add27db4e53a9e5cf6580378230b57f81d47284e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 1 Nov 2015 08:45:50 +0100 Subject: compat: we can't use Qt here --- opentrack-compat/shm.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'opentrack-compat/shm.h') diff --git a/opentrack-compat/shm.h b/opentrack-compat/shm.h index 7c8a66a9..53248ac6 100644 --- a/opentrack-compat/shm.h +++ b/opentrack-compat/shm.h @@ -18,14 +18,29 @@ #include #include #endif -#include + +#ifdef __GNUC__ +# define COMPAT_GNUC_VISIBILITY __attribute__ ((visibility ("default"))) +#else +# define COMPAT_GNUC_VISIBILITY +#endif #ifdef BUILD_opentrack_compat -# define COMPAT_EXPORT Q_DECL_EXPORT +# ifdef _WIN32 +# define COMPAT_WIN32_EXPORT __declspec(dllexport) +# else +# define COMPAT_WIN32_EXPORT +# endif #else -# define COMPAT_EXPORT Q_DECL_IMPORT +# ifdef _WIN32 +# define COMPAT_WIN32_EXPORT __declspec(dllimport) +# else +# define COMPAT_WIN32_EXPORT +# endif #endif +#define COMPAT_EXPORT COMPAT_WIN32_EXPORT COMPAT_GNUC_VISIBILITY + class COMPAT_EXPORT PortableLockedShm { public: PortableLockedShm(const char *shmName, const char *mutexName, int mapSize); -- cgit v1.2.3 From 4bbfd73825b1cb6a27e19ea518ad0bed7c806b6c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 1 Nov 2015 08:47:42 +0100 Subject: shm: ignore diagnostic for Wine build --- opentrack-compat/shm.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'opentrack-compat/shm.h') diff --git a/opentrack-compat/shm.h b/opentrack-compat/shm.h index 53248ac6..c74534e7 100644 --- a/opentrack-compat/shm.h +++ b/opentrack-compat/shm.h @@ -19,6 +19,9 @@ #include #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wattributes" + #ifdef __GNUC__ # define COMPAT_GNUC_VISIBILITY __attribute__ ((visibility ("default"))) #else @@ -57,3 +60,5 @@ private: int fd, size; #endif }; + +#pragma GCC diagnostic pop -- cgit v1.2.3