summaryrefslogtreecommitdiffhomepage
path: root/opentrack-compat/shm.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-11-01 08:45:50 +0100
committerStanislaw Halik <sthalik@misaki.pl>2015-11-01 08:49:12 +0100
commitadd27db4e53a9e5cf6580378230b57f81d47284e (patch)
tree12e8e303add81e0da136e1b70256f18b0717113a /opentrack-compat/shm.h
parente04fe7d7b412c502c30c3eaf9d54b0eebf708d2b (diff)
compat: we can't use Qt here
Diffstat (limited to 'opentrack-compat/shm.h')
-rw-r--r--opentrack-compat/shm.h21
1 files changed, 18 insertions, 3 deletions
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 <unistd.h>
#include <sys/types.h>
#endif
-#include <QtGlobal>
+
+#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);