From 59bd2a104c9be7309271f2d5121617d8029cd58e Mon Sep 17 00:00:00 2001 From: Maikel Maes Date: Thu, 19 Jun 2025 14:25:40 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20Port=20to=20macOS=2015.5=20(Sequoia)=20?= =?UTF-8?q?=E2=80=93=20clang++=20compatibility,=20std::swap,=20Data()=20te?= =?UTF-8?q?mplating?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/datamodel/dmattributevar.h | 9 +++++++++ public/tier1/utlblockmemory.h | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/public/datamodel/dmattributevar.h b/public/datamodel/dmattributevar.h index e0ce32f5f..b5f26c9a0 100644 --- a/public/datamodel/dmattributevar.h +++ b/public/datamodel/dmattributevar.h @@ -105,6 +105,9 @@ class CDmaElement : public CDmaVar< DmElementHandle_t > // NULL check bool operator!() const; + // Returns the underlying DmElementHandle_t data + const DmElementHandle_t& Data() const; + // Assignment.. wish I knew how to un-inline these methods template CDmaElement &operator=( S* pElement ) { @@ -1136,6 +1139,12 @@ inline void CDmaElement::InitAndCreate( CDmElement *pOwner, const char *pAttr m_pAttribute->AddFlag( flags | FATTRIB_MUSTCOPY ); } +template +inline const DmElementHandle_t& CDmaElement::Data() const +{ + return Value(); +} + template inline void CDmaElement::Init( CDmElement *pOwner, const char *pAttributeName, int flags ) { diff --git a/public/tier1/utlblockmemory.h b/public/tier1/utlblockmemory.h index 35ef2da2e..aa1ae034e 100644 --- a/public/tier1/utlblockmemory.h +++ b/public/tier1/utlblockmemory.h @@ -137,10 +137,10 @@ CUtlBlockMemory::~CUtlBlockMemory() template< class T, class I > void CUtlBlockMemory::Swap( CUtlBlockMemory< T, I > &mem ) { - this->swap( m_pMemory, mem.m_pMemory ); - this->swap( m_nBlocks, mem.m_nBlocks ); - this->swap( m_nIndexMask, mem.m_nIndexMask ); - this->swap( m_nIndexShift, mem.m_nIndexShift ); + std::swap( m_pMemory, mem.m_pMemory ); + std::swap( m_nBlocks, mem.m_nBlocks ); + std::swap( m_nIndexMask, mem.m_nIndexMask ); + std::swap( m_nIndexShift, mem.m_nIndexShift ); }