kwin: build for platform that don't have atomic_int64

I can make it built but I can't test it :(
This commit is contained in:
Đoàn Trần Công Danh 2021-02-24 08:46:57 +07:00
parent bfbe58d1af
commit aec36a4bc9
2 changed files with 36 additions and 4 deletions

View file

@ -0,0 +1,36 @@
--- src/ftrace.h
+++ src/ftrace.h
@@ -11,6 +11,7 @@
#include <kwinglobals.h>
+#include <type_traits>
#include <QFile>
#include <QMutex>
#include <QMutexLocker>
@@ -70,10 +71,15 @@ private:
class KWIN_EXPORT FTraceDuration
{
+ using ftrace_context_t = std::conditional<
+ QAtomicOpsSupport<sizeof(qulonglong)>::IsSupported,
+ qulonglong,
+ ulong>::type;
+
public:
template<typename... Args> FTraceDuration(Args... args)
{
- static QAtomicInteger<qulonglong> s_context = 0;
+ static QAtomicInteger<ftrace_context_t> s_context = 0;
QTextStream stream(&m_message);
(stream << ... << args);
stream.flush();
@@ -85,7 +91,7 @@ public:
private:
QByteArray m_message;
- qulonglong m_context;
+ ftrace_context_t m_context;
};
} // namespace KWin

View file

@ -30,10 +30,6 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
makedepends+=" libatomic-devel"
fi
if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
broken="Q_STATIC_ASSERT_X(QAtomicOpsSupport<sizeof(T)>::IsSupported"
fi
post_extract() {
_qt5_dep_ver="${depends#*>=}"
_qt5_dep_ver="${_qt5_dep_ver%<*}"