summaryrefslogtreecommitdiffhomepage
path: root/opentrack-compat/shm.h
diff options
context:
space:
mode:
Diffstat (limited to 'opentrack-compat/shm.h')
-rw-r--r--opentrack-compat/shm.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/opentrack-compat/shm.h b/opentrack-compat/shm.h
index 17a0d843..c74534e7 100644
--- a/opentrack-compat/shm.h
+++ b/opentrack-compat/shm.h
@@ -19,7 +19,32 @@
#include <sys/types.h>
#endif
-class PortableLockedShm {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wattributes"
+
+#ifdef __GNUC__
+# define COMPAT_GNUC_VISIBILITY __attribute__ ((visibility ("default")))
+#else
+# define COMPAT_GNUC_VISIBILITY
+#endif
+
+#ifdef BUILD_opentrack_compat
+# ifdef _WIN32
+# define COMPAT_WIN32_EXPORT __declspec(dllexport)
+# else
+# define COMPAT_WIN32_EXPORT
+# endif
+#else
+# 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);
~PortableLockedShm();
@@ -35,3 +60,5 @@ private:
int fd, size;
#endif
};
+
+#pragma GCC diagnostic pop