aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-05-06 16:52:57 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-05-07 13:16:56 +0000
commit64c22f1691ff78e538800e1715da3488ba9e1baf (patch)
tree89f4321f36f1a3ff686b48e12519aa0e029c2869
parentcd45937c2420e063346867b987ac47651511601c (diff)
MASM: Put pageSize into an inline namespace
Apple errorneously detects pagesize as belonging to their private API. Avoid this by putting the functions into an inline namespace to change their mangling. Fixes: QTBUG-69577 Change-Id: I061febdc6f961fa8a6e1d43de4154a8e26b04f27 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 719fa10c8219537187f2e3c63eacdf44bd76d410) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/3rdparty/masm/wtf/PageBlock.cpp2
-rw-r--r--src/3rdparty/masm/wtf/PageBlock.h5
2 files changed, 7 insertions, 0 deletions
diff --git a/src/3rdparty/masm/wtf/PageBlock.cpp b/src/3rdparty/masm/wtf/PageBlock.cpp
index e715ed262a..bc0e8d6f2d 100644
--- a/src/3rdparty/masm/wtf/PageBlock.cpp
+++ b/src/3rdparty/masm/wtf/PageBlock.cpp
@@ -64,6 +64,7 @@ inline size_t systemPageSize()
#endif
+inline namespace hidden {
size_t pageSize()
{
if (!s_pageSize)
@@ -78,5 +79,6 @@ size_t pageMask()
s_pageMask = ~(pageSize() - 1);
return s_pageMask;
}
+}
} // namespace WTF
diff --git a/src/3rdparty/masm/wtf/PageBlock.h b/src/3rdparty/masm/wtf/PageBlock.h
index 09e4048239..d85c39cb33 100644
--- a/src/3rdparty/masm/wtf/PageBlock.h
+++ b/src/3rdparty/masm/wtf/PageBlock.h
@@ -28,8 +28,13 @@
namespace WTF {
+// avoid false positive detection by apple
+// by putting the function inside an inline namespace
+// to obtain different name mangling
+inline namespace hidden {
WTF_EXPORT_PRIVATE size_t pageSize();
WTF_EXPORT_PRIVATE size_t pageMask();
+}
inline bool isPageAligned(void* address) { return !(reinterpret_cast<intptr_t>(address) & (pageSize() - 1)); }
inline bool isPageAligned(size_t size) { return !(size & (pageSize() - 1)); }
inline bool isPowerOfTwo(size_t size) { return !(size & (size - 1)); }