<commit_before>From badaca1b793199578f36160101c1d3288193cdb0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <<EMAIL>>
Date: Mon, 26 Feb 2018 14:39:52 +0100
Subject: [PATCH] Fix release build with Qt 5.10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Moving Qt from 5.9.4 -> 5.10.1 causes build failures for mixxx:

| <command-line>:0:20: error: call to non-constexpr function 'void qt_noop()'
| /usr/include/qt5/QtCore/qstringview.h:291:14: note: in expansion of macro 'Q_ASSERT'
|     { return Q_ASSERT(int(size()) == size()), int(size()); }
| .. many-more errors of same kind

This is caused by a different usage of Q_ASSERT in qtbase. For further details
see qtbase

commit 8ea27bb1c669e21100a6a042b0378b3346bdf671
Author: <NAME> <<EMAIL>>
Date:   Tue Mar 14 22:45:05 2017 +0100

    Make Q_ASSERT() usable in constexpr functions

Fix mixxx by copying/aliging the new definition of Q_ASSERT from qglobal.h
shipped with 5.10.1.

Tested for Qt 5.9.4 and 5.10.1

Upstream-Status: Submitted [1]

[1] https://github.com/mixxxdj/mixxx/pull/1526

Signed-off-by: <NAME> <<EMAIL>>
---
 build/depends.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build/depends.py b/build/depends.py
index 4b88034f2..399a2c237 100644
--- a/build/depends.py
+++ b/build/depends.py
@@ -1260,7 +1260,7 @@ class MixxxCore(Feature):
             # that we include. We can't define QT_NO_DEBUG because that would
             # mean turning off QDebug output. qt_noop() is what Qt defines
             # Q_ASSERT to be when QT_NO_DEBUG is defined.
-            build.env.Append(CPPDEFINES="'Q_ASSERT(x)=qt_noop()'")
+            build.env.Append(CPPDEFINES="'Q_ASSERT(cond)=static_cast<void>(false&&(cond))'")
 
         if int(SCons.ARGUMENTS.get('debug_assertions_fatal', 0)):
             build.env.Append(CPPDEFINES='MIXXX_DEBUG_ASSERTIONS_FATAL')
-- 
2.14.3
<commit_msg>mixxx: align patch to the latest version sent to upstream<commit_after>From 2f0e2efee933c8be2e69bfa1dbbaa8eeed22ee6c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <<EMAIL>>
Date: Mon, 26 Feb 2018 14:39:52 +0100
Subject: [PATCH] Fix release build with Qt 5.10
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Moving Qt from 5.9.4 -> 5.10.1 causes build failures for mixxx:

| <command-line>:0:20: error: call to non-constexpr function 'void qt_noop()'
| /usr/include/qt5/QtCore/qstringview.h:291:14: note: in expansion of macro 'Q_ASSERT'
|     { return Q_ASSERT(int(size()) == size()), int(size()); }
| .. many-more errors of same kind

This is caused by a different usage of Q_ASSERT in qtbase. For further details
see qtbase

commit 8ea27bb1c669e21100a6a042b0378b3346bdf671
Author: <NAME> <<EMAIL>>
Date:   Tue Mar 14 22:45:05 2017 +0100

    Make Q_ASSERT() usable in constexpr functions

Fix mixxx by copying/aliging the new definition of Q_ASSERT from qglobal.h
shipped with 5.10.1.

Tested on Linux with Qt 5.9.4 and 5.10.1

Upstream-Status: Submitted [1]

[1] https://github.com/mixxxdj/mixxx/pull/1526

Signed-off-by: <NAME> <<EMAIL>>
---
 build/depends.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/build/depends.py b/build/depends.py
index 4b88034f2..a53ba166b 100644
--- a/build/depends.py
+++ b/build/depends.py
@@ -1258,9 +1258,9 @@ class MixxxCore(Feature):
 
             # In a release build we want to disable all Q_ASSERTs in Qt headers
             # that we include. We can't define QT_NO_DEBUG because that would
-            # mean turning off QDebug output. qt_noop() is what Qt defines
-            # Q_ASSERT to be when QT_NO_DEBUG is defined.
-            build.env.Append(CPPDEFINES="'Q_ASSERT(x)=qt_noop()'")
+            # mean turning off QDebug output. So we pass the same code as qtbase
+            # uses in qglobal.h for QT_NO_DEBUG set from qtbase 5.10 on.
+            build.env.Append(CPPDEFINES="'Q_ASSERT(x)=static_cast<void>(false&&(x))'")
 
         if int(SCons.ARGUMENTS.get('debug_assertions_fatal', 0)):
             build.env.Append(CPPDEFINES='MIXXX_DEBUG_ASSERTIONS_FATAL')
-- 
2.14.3

{'fraction_non_alphanumeric': 0.12791536427025726, 'fraction_numerical': 0.08439528732868477, 'mean_word_length': 3.611973392461197, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6082115', 'n_tokens_mistral': 1773, 'n_tokens_neox': 1504, 'n_words': 415}