From 775d56f01d39c438c48397bdd571a607fb03abc3 Mon Sep 17 00:00:00 2001 From: Pavel Dubsky Date: Wed, 5 Feb 2025 21:16:03 +0100 Subject: [PATCH] Move UUID definitions out of Qt namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When UUID definitions are placed within Qt namespace MinGW build fails because specializations of struct __mingw_uuidof_s are now defined in a different namespace. Fixes: QTBUG-133516 Pick-to: 6.8 6.5 Change-Id: I49270aa2a892d407675dab7b90d3929d120c5224 Reviewed-by: Jøger Hansegård (cherry picked from commit 84b7cef13913139b2ed7e506ace0fa6b97269829) Reviewed-by: Qt Cherry-pick Bot --- .../windows/qcomobject/tst_qcomobject.cpp | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/tests/auto/corelib/platform/windows/qcomobject/tst_qcomobject.cpp b/tests/auto/corelib/platform/windows/qcomobject/tst_qcomobject.cpp index 903ba208dfb..616f813bbff 100644 --- a/tests/auto/corelib/platform/windows/qcomobject/tst_qcomobject.cpp +++ b/tests/auto/corelib/platform/windows/qcomobject/tst_qcomobject.cpp @@ -16,33 +16,31 @@ IIntermediate : public IUnknown{}; MIDL_INTERFACE("65a29ce9-191c-4182-9185-06dd70aafc5d") IDirect : public IIntermediate{}; -class ComImplementation : public QComObject -{ -}; - MIDL_INTERFACE("d05397e0-da7f-4055-8563-a5b80f095e6c") IMultipleA : public IUnknown{}; MIDL_INTERFACE("67e298c5-ec5f-4c45-a779-bfba2484e142") IMultipleB : public IUnknown{}; -class MultipleComImplementation : public QComObject -{ -}; - MIDL_INTERFACE("b8278a1b-0c3b-4bbd-99db-1e8a141483fa") IOther : public IUnknown{}; -# ifdef __CRT_UUID_DECL -__CRT_UUID_DECL(IIntermediate, 0x878fab04, 0x7da0, 0x41ea, 0x9c, 0x49, 0x05, 0x8c, 0x7f, 0xa0, 0xd8, - 0x0a) -__CRT_UUID_DECL(IDirect, 0x65a29ce9, 0x191c, 0x4182, 0x91, 0x85, 0x06, 0xdd, 0x70, 0xaa, 0xfc, 0x5d) -__CRT_UUID_DECL(IMultipleA, 0xd05397e0, 0xda7f, 0x4055, 0x85, 0x63, 0xa5, 0xb8, 0x0f, 0x09, 0x5e, - 0x6c) -__CRT_UUID_DECL(IMultipleB, 0x67e298c5, 0xec5f, 0x4c45, 0xa7, 0x79, 0xbf, 0xba, 0x24, 0x84, 0xe1, - 0x42) -__CRT_UUID_DECL(IOther, 0xb8278a1b, 0x0c3b, 0x4bbd, 0x99, 0xdb, 0x1e, 0x8a, 0x14, 0x14, 0x83, 0xfa) -# endif +QT_END_NAMESPACE + +#ifdef __CRT_UUID_DECL +__CRT_UUID_DECL(QT_PREPEND_NAMESPACE(IIntermediate), 0x878fab04, 0x7da0, 0x41ea, 0x9c, 0x49, 0x05, + 0x8c, 0x7f, 0xa0, 0xd8, 0x0a) +__CRT_UUID_DECL(QT_PREPEND_NAMESPACE(IDirect), 0x65a29ce9, 0x191c, 0x4182, 0x91, 0x85, 0x06, 0xdd, + 0x70, 0xaa, 0xfc, 0x5d) +__CRT_UUID_DECL(QT_PREPEND_NAMESPACE(IMultipleA), 0xd05397e0, 0xda7f, 0x4055, 0x85, 0x63, 0xa5, + 0xb8, 0x0f, 0x09, 0x5e, 0x6c) +__CRT_UUID_DECL(QT_PREPEND_NAMESPACE(IMultipleB), 0x67e298c5, 0xec5f, 0x4c45, 0xa7, 0x79, 0xbf, + 0xba, 0x24, 0x84, 0xe1, 0x42) +__CRT_UUID_DECL(QT_PREPEND_NAMESPACE(IOther), 0xb8278a1b, 0x0c3b, 0x4bbd, 0x99, 0xdb, 0x1e, 0x8a, + 0x14, 0x14, 0x83, 0xfa) +#endif + +QT_BEGIN_NAMESPACE namespace QtPrivate { @@ -56,6 +54,15 @@ struct QComObjectTraits }; } // namespace QtPrivate + +class ComImplementation : public QComObject +{ +}; + +class MultipleComImplementation : public QComObject +{ +}; + QT_END_NAMESPACE class tst_QComObject : public QObject @@ -249,6 +256,6 @@ void tst_QComObject::Release_decrementsReferenceCountByOne() } QTEST_MAIN(tst_QComObject) -# include "tst_qcomobject.moc" +#include "tst_qcomobject.moc" #endif // Q_OS_WIN