diff options
Diffstat (limited to 'opentrack-compat')
-rw-r--r-- | opentrack-compat/CMakeLists.txt | 2 | ||||
-rw-r--r-- | opentrack-compat/shm.h | 29 |
2 files changed, 29 insertions, 2 deletions
diff --git a/opentrack-compat/CMakeLists.txt b/opentrack-compat/CMakeLists.txt index 4f5fd724..a92f4f31 100644 --- a/opentrack-compat/CMakeLists.txt +++ b/opentrack-compat/CMakeLists.txt @@ -1,4 +1,4 @@ -opentrack_boilerplate(opentrack-compat STATIC NO-COMPAT) +opentrack_boilerplate(opentrack-compat NO-COMPAT NO-LINKER-SCRIPT) if(NOT WIN32 AND NOT APPLE) target_link_libraries(opentrack-compat rt) endif() 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 |