summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
authorDonovan Baarda <abo@minkirri.apana.org.au>2014-10-15 14:07:20 +1100
committerDonovan Baarda <abo@minkirri.apana.org.au>2014-10-15 14:07:20 +1100
commitdbd04e283082ab869a22abf03c4c6280b03935bb (patch)
tree3951c6f91f76047e655f35e04db4eecd576c49df /compat
parentd880464fbe9180aefde94594330126e115066dc3 (diff)
parent051a2e4392bc75b246cc5cb897ae0bbb1f92042e (diff)
Merge branch 'unstable' of https://github.com/opentrack/opentrack into dev/kalman
Conflicts: ftnoir_filter_kalman/ftnoir_filter_kalman.h
Diffstat (limited to 'compat')
-rw-r--r--compat/compat.cpp9
-rw-r--r--compat/compat.h4
-rw-r--r--compat/qt-bug-appeasement.cpp1
3 files changed, 5 insertions, 9 deletions
diff --git a/compat/compat.cpp b/compat/compat.cpp
index 7b695617..b5d63f2b 100644
--- a/compat/compat.cpp
+++ b/compat/compat.cpp
@@ -4,12 +4,12 @@
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*/
+
+#include <cstring>
#define IN_FTNOIR_COMPAT
#include "compat.h"
-#include <string.h>
#if defined(_WIN32)
-
PortableLockedShm::PortableLockedShm(const char* shmName, const char* mutexName, int mapSize)
{
hMutex = CreateMutexA(NULL, false, mutexName);
@@ -43,8 +43,8 @@ void PortableLockedShm::unlock()
{
(void) ReleaseMutex(hMutex);
}
-
#else
+#pragma GCC diagnostic ignored "-Wunused-result"
PortableLockedShm::PortableLockedShm(const char *shmName, const char* /*mutexName*/, int mapSize) : size(mapSize)
{
char filename[512] = {0};
@@ -57,8 +57,6 @@ PortableLockedShm::PortableLockedShm(const char *shmName, const char* /*mutexNam
PortableLockedShm::~PortableLockedShm()
{
- //(void) shm_unlink(shm_filename);
-
(void) munmap(mem, size);
(void) close(fd);
}
@@ -72,7 +70,6 @@ void PortableLockedShm::unlock()
{
flock(fd, LOCK_UN);
}
-
#endif
bool PortableLockedShm::success()
diff --git a/compat/compat.h b/compat/compat.h
index 0e488752..490d8913 100644
--- a/compat/compat.h
+++ b/compat/compat.h
@@ -38,12 +38,12 @@ public:
void lock();
void unlock();
bool success();
- void* mem;
+ inline void* ptr() { return mem; }
private:
+ void* mem;
#if defined(_WIN32)
HANDLE hMutex, hMapFile;
#else
int fd, size;
- //char shm_filename[NAME_MAX];
#endif
};
diff --git a/compat/qt-bug-appeasement.cpp b/compat/qt-bug-appeasement.cpp
deleted file mode 100644
index 9a86ac0a..00000000
--- a/compat/qt-bug-appeasement.cpp
+++ /dev/null
@@ -1 +0,0 @@
-#include "facetracknoir/qt-moc.h"