1
0
forked from pool/libqt5-qtbase
libqt5-qtbase/0001-Fix-qfloat16-methods-definition-without-declaration-.patch
Dominique Leuenberger 21fa05ea88 Accepting request 660518 from KDE:Qt5
- Add 0001-Fix-qfloat16-methods-definition-without-declaration-.patch
  (a slightly different version of workaround-qdoc-failure.patch in
  libqt5-qtdoc, which was submitted upstream to fix libqt5-qtdoc
  building also when qt modules other than qtbase include qfloat16.h
  from the system qtbase package (boo#1092425, qtbug#72725)

OBS-URL: https://build.opensuse.org/request/show/660518
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=91
2018-12-26 23:22:30 +00:00

45 lines
1.4 KiB
Diff

From edc15323b4ef13a2a58ba4bebd46a78449b628ee Mon Sep 17 00:00:00 2001
From: Antonio Larrosa <alarrosa@suse.com>
Date: Fri, 21 Dec 2018 12:33:39 +0100
Subject: [PATCH] Fix qfloat16 methods definition without declaration when
using Q_QDOC
This fixes qtdoc failing to build on i586 because of an assertion in
libclang since Q_QDOC is defined and thus the declaration of the
qfloat16(float) constructor and operator float() are removed, thus
their definitions should be removed too, which is what this patch
does.
This patch was done together with Michal Srb <msrb@suse.com>.
Fixes: QTBUG-72725
Change-Id: I6424873425d46345e09f411f9ce88f2520825da4
---
src/corelib/global/qfloat16.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h
index a8befd7adb..3e50ad8467 100644
--- a/src/corelib/global/qfloat16.h
+++ b/src/corelib/global/qfloat16.h
@@ -123,6 +123,7 @@ Q_REQUIRED_RESULT inline bool qIsNull(qfloat16 f) Q_DECL_NOTHROW
inline int qIntCast(qfloat16 f) Q_DECL_NOTHROW
{ return int(static_cast<float>(f)); }
+#ifndef Q_QDOC
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wc99-extensions")
QT_WARNING_DISABLE_GCC("-Wold-style-cast")
@@ -162,6 +163,7 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW
return f;
#endif
}
+#endif
inline qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW
{
--
2.19.2