summaryrefslogtreecommitdiffhomepage
path: root/compat/shm.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-07-16 17:36:11 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-07-16 17:36:33 +0200
commit1352d0750ef1ee871388a610e9d8813bc07c754d (patch)
tree039bdb88527479edf6924815cc80873a1ed3ce2b /compat/shm.h
parente016dca372bf69f3bb4967a8aba374bc04aea3b4 (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.h28
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; }
+};