diff options
author | Dennis Oberst <dennis.oberst@qt.io> | 2023-07-31 12:12:36 +0200 |
---|---|---|
committer | Dennis Oberst <dennis.oberst@qt.io> | 2023-08-02 15:11:45 +0000 |
commit | da5f2fc6be6768275501be6ec3e1b742fb995e9e (patch) | |
tree | e222c27b3dd214a6f64021ac1b692b8438aede0d | |
parent | 592494e2e59a16e6d9ecf9f6f865e2df3de99a18 (diff) |
QFreeList: Resolve symbol ambiguity in unity build
Remove 'qfreelist.cpp' from the NO_UNITY_BUILD_SOURCES section
and fix the underlying problem of the clashing symbols with
'qabstracteventdispatcher.cpp', by wrapping the unnamed enum in
a namespace.
Amends: a07426d23a02bd4029c6576f92fa43d324ff56be.
Task-number: QTBUG-109394
Pick-to: 6.6 6.5
Change-Id: I585ab06a33d46a11a48220f504c53a5f4fa91d7e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
-rw-r--r-- | src/corelib/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/corelib/tools/qfreelist.cpp | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 3333bc1a62..adfb67ffd6 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -310,7 +310,6 @@ qt_internal_add_module(Core tools/qvector.h tools/qversionnumber.cpp tools/qversionnumber.h NO_UNITY_BUILD_SOURCES - tools/qfreelist.cpp # Size0/Offset0 (also in qabstracteventdispatcher.cpp) # MinGW complains about `free-nonheap-object` in ~QSharedDataPointer() # despite the fact that appropriate checks are in place to avoid that! tools/qshareddata.cpp tools/qshareddata.h diff --git a/src/corelib/tools/qfreelist.cpp b/src/corelib/tools/qfreelist.cpp index 45bd3ba8ae..db15fac5d6 100644 --- a/src/corelib/tools/qfreelist.cpp +++ b/src/corelib/tools/qfreelist.cpp @@ -6,6 +6,7 @@ QT_BEGIN_NAMESPACE // default sizes and offsets (no need to define these when customizing) +namespace QFreeListDefaultConstantsPrivate { enum { Offset0 = 0x00000000, Offset1 = 0x00008000, @@ -17,12 +18,13 @@ enum { Size2 = Offset3 - Offset2, Size3 = QFreeListDefaultConstants::MaxIndex - Offset3 }; +} Q_CONSTINIT const int QFreeListDefaultConstants::Sizes[QFreeListDefaultConstants::BlockCount] = { - Size0, - Size1, - Size2, - Size3 + QFreeListDefaultConstantsPrivate::Size0, + QFreeListDefaultConstantsPrivate::Size1, + QFreeListDefaultConstantsPrivate::Size2, + QFreeListDefaultConstantsPrivate::Size3 }; QT_END_NAMESPACE |