From d4ad8c6f6a470d303622abd82dbbc3203a42bfed Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Thu, 6 May 2021 16:52:57 +0200 Subject: MASM: Put pageSize into an inline namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø (cherry picked from commit 719fa10c8219537187f2e3c63eacdf44bd76d410) Reviewed-by: Qt Cherry-pick Bot --- src/3rdparty/masm/wtf/PageBlock.cpp | 2 ++ src/3rdparty/masm/wtf/PageBlock.h | 5 +++++ 2 files changed, 7 insertions(+) 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(address) & (pageSize() - 1)); } inline bool isPageAligned(size_t size) { return !(size & (pageSize() - 1)); } inline bool isPowerOfTwo(size_t size) { return !(size & (size - 1)); } -- cgit v1.2.3