summaryrefslogtreecommitdiffhomepage
path: root/compat
diff options
context:
space:
mode:
Diffstat (limited to 'compat')
-rw-r--r--compat/check-visible.cpp6
-rw-r--r--compat/linkage-macros.hpp5
-rw-r--r--compat/shm.cpp17
-rw-r--r--compat/util.hpp2
4 files changed, 23 insertions, 7 deletions
diff --git a/compat/check-visible.cpp b/compat/check-visible.cpp
index 436e1fdd..a47af156 100644
--- a/compat/check-visible.cpp
+++ b/compat/check-visible.cpp
@@ -53,12 +53,12 @@ bool check_is_visible()
#else
-force_inline OTR_COMPAT_EXPORT
-void set_is_visible(const QWidget&)
+never_inline OTR_COMPAT_EXPORT
+void set_is_visible(const QWidget&, bool)
{
}
-force_inline OTR_COMPAT_EXPORT
+never_inline OTR_COMPAT_EXPORT
bool check_is_visible()
{
return true;
diff --git a/compat/linkage-macros.hpp b/compat/linkage-macros.hpp
index a4c4b351..9e71ac8c 100644
--- a/compat/linkage-macros.hpp
+++ b/compat/linkage-macros.hpp
@@ -1,8 +1,11 @@
#pragma once
-#if defined _MSC_VER || defined _WIN32
+#if defined _MSC_VER
# define OTR_GENERIC_EXPORT __declspec(dllexport)
# define OTR_GENERIC_IMPORT __declspec(dllimport)
+#elif defined _WIN32 && !defined(__WINE__)
+# define OTR_GENERIC_EXPORT __attribute__((dllexport, visibility ("default")))
+# define OTR_GENERIC_IMPORT __attribute__((dllimport))
#else
# define OTR_GENERIC_EXPORT __attribute__ ((visibility ("default")))
# define OTR_GENERIC_IMPORT
diff --git a/compat/shm.cpp b/compat/shm.cpp
index 88a2811d..a933f7f9 100644
--- a/compat/shm.cpp
+++ b/compat/shm.cpp
@@ -7,10 +7,12 @@
#include "shm.h"
-#include <QDebug>
-
#if defined(_WIN32)
+#if !defined __WINE__
+# include <QDebug>
+#endif
+
#include <cstring>
#include <stdio.h>
@@ -114,7 +116,9 @@ PortableLockedShm::PortableLockedShm(const char* shmName, const char* mutexName,
if (!hMutex)
{
+#if !defined __WINE__
qDebug() << "CreateMutexA:" << (int) GetLastError();
+#endif
return;
}
@@ -128,7 +132,9 @@ PortableLockedShm::PortableLockedShm(const char* shmName, const char* mutexName,
if (!hMapFile)
{
+#if !defined __WINE__
qDebug() << "CreateFileMappingA:", (int) GetLastError();
+#endif
return;
}
@@ -140,7 +146,11 @@ PortableLockedShm::PortableLockedShm(const char* shmName, const char* mutexName,
mapSize);
if (!mem)
+ {
+#if !defined __WINE__
qDebug() << "MapViewOfFile:" << (int) GetLastError();
+#endif
+ }
}
PortableLockedShm::~PortableLockedShm()
@@ -157,7 +167,10 @@ PortableLockedShm::~PortableLockedShm()
return;
fail:
+ (void)0;
+#if !defined __WINE__
qDebug() << "failed to close mapping";
+#endif
}
bool PortableLockedShm::lock()
diff --git a/compat/util.hpp b/compat/util.hpp
index 88bff96c..5ae87632 100644
--- a/compat/util.hpp
+++ b/compat/util.hpp
@@ -118,7 +118,7 @@ template<typename t> using qshared = QSharedPointer<t>;
#if defined _MSC_VER
# define force_inline __forceinline
#elif defined __GNUG__
-# define force_inline __attribute__((always_inline, gnu_inline))
+# define force_inline __attribute__((always_inline, gnu_inline)) inline
#else
# define force_inline inline
#endif