25 lines
577 B
Diff
25 lines
577 B
Diff
--- src/qmplay2/QMPlay2OSD.cpp.orig 2018-10-21 13:35:36.079993098 +0200
|
|
+++ src/qmplay2/QMPlay2OSD.cpp 2018-10-21 13:38:08.398003961 +0200
|
|
@@ -19,11 +19,21 @@
|
|
#include <QMPlay2OSD.hpp>
|
|
|
|
#include <QAtomicInteger>
|
|
+#ifdef Q_ATOMIC_INT64_IS_SUPPORTED
|
|
static QAtomicInteger<quint64> g_id;
|
|
+#else
|
|
+static QAtomicInteger<quint32> g_id[2];
|
|
+#endif
|
|
|
|
void QMPlay2OSD::genId()
|
|
{
|
|
+#ifdef Q_ATOMIC_INT64_IS_SUPPORTED
|
|
m_id = ++g_id;
|
|
+#else
|
|
+ if (0 == ++g_id[0])
|
|
+ ++g_id[1];
|
|
+ m_id = (static_cast<quint64>(g_id[1]) << 32) | g_id[0];
|
|
+#endif
|
|
}
|
|
|
|
void QMPlay2OSD::clear(bool all)
|