diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-07-16 17:36:11 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-07-16 17:36:33 +0200 |
commit | 1352d0750ef1ee871388a610e9d8813bc07c754d (patch) | |
tree | 039bdb88527479edf6924815cc80873a1ed3ce2b /compat/shm.h | |
parent | e016dca372bf69f3bb4967a8aba374bc04aea3b4 (diff) |
compat/shm: reorder code
Hopefully prevent getting misdetected by an antivirus.
Issue: #654
Diffstat (limited to 'compat/shm.h')
-rw-r--r-- | compat/shm.h | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/compat/shm.h b/compat/shm.h index ffd1e1dc..3b37a8a3 100644 --- a/compat/shm.h +++ b/compat/shm.h @@ -19,30 +19,22 @@ #include <sys/types.h> #endif -#ifdef __GNUC__ -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wattributes" -#endif - #include "export.hpp" -class OTR_COMPAT_EXPORT PortableLockedShm { -public: - PortableLockedShm(const char *shmName, const char *mutexName, int mapSize); - ~PortableLockedShm(); - void lock(); - void unlock(); - bool success(); - inline void* ptr() { return mem; } -private: +class OTR_COMPAT_EXPORT PortableLockedShm final +{ void* mem; #if defined(_WIN32) HANDLE hMutex, hMapFile; #else int fd, size; #endif -}; -#ifdef __GNUC__ -# pragma GCC diagnostic pop -#endif +public: + PortableLockedShm(const char *shmName, const char *mutexName, int mapSize); + ~PortableLockedShm(); + bool lock(); + bool unlock(); + bool success(); + inline void* ptr() { return mem; } +}; |