aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-05-06 16:52:57 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2021-05-07 10:59:39 +0200
commit719fa10c8219537187f2e3c63eacdf44bd76d410 (patch)
tree90e7ce2eb00a6f0619074620d90e0dd8ffd46d27 /src/3rdparty
parent7643401f3eada139ca89f37dfa6a6860ddaf3269 (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 Pick-to: 6.1 5.15 5.12 Change-Id: I061febdc6f961fa8a6e1d43de4154a8e26b04f27 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/3rdparty')
-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)); }