From 68db615cd5f5ef731ca7018b251b43106c5a9f47 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 16 Nov 2017 19:38:10 -0800 Subject: Fixed Android build issues --- Common/include/DebugUtilities.h | 4 +++- Common/include/FixedBlockMemoryAllocator.h | 2 +- Common/include/ValidatedCast.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) (limited to 'Common/include') diff --git a/Common/include/DebugUtilities.h b/Common/include/DebugUtilities.h index 040a3447..b8178d97 100644 --- a/Common/include/DebugUtilities.h +++ b/Common/include/DebugUtilities.h @@ -28,6 +28,8 @@ #ifdef _DEBUG +#include + // This function is only requried to ensure that Message argument passed to the macro // is actually string and not something else inline void EnsureStr( const char* ){} @@ -58,7 +60,7 @@ inline void EnsureStr( const char* ){} template void CheckDynamicType( SrcType *pSrcPtr ) { - VERIFY( pSrcPtr == nullptr || dynamic_cast (pSrcPtr) != nullptr, "Dynamic type cast failed!" ); + VERIFY(pSrcPtr == nullptr || dynamic_cast (pSrcPtr) != nullptr, "Dynamic type cast failed. Src typeid: \'", typeid(*pSrcPtr).name(), "\' Dst typeid: \'", typeid(DstType).name(), '\''); } # define CHECK_DYNAMIC_TYPE(DstType, pSrcPtr) CheckDynamicType(pSrcPtr) diff --git a/Common/include/FixedBlockMemoryAllocator.h b/Common/include/FixedBlockMemoryAllocator.h index 93748c5b..9983291c 100644 --- a/Common/include/FixedBlockMemoryAllocator.h +++ b/Common/include/FixedBlockMemoryAllocator.h @@ -211,7 +211,7 @@ private: std::vector > m_PagePool; std::unordered_set, std::equal_to, STDAllocatorRawMem > m_AvailablePages; - typedef std::pair AddrToPageIdMapElem; + typedef std::pair AddrToPageIdMapElem; std::unordered_map, std::equal_to, STDAllocatorRawMem > m_AddrToPageId; std::mutex m_Mutex; diff --git a/Common/include/ValidatedCast.h b/Common/include/ValidatedCast.h index 1b775ad6..6b4b47ad 100644 --- a/Common/include/ValidatedCast.h +++ b/Common/include/ValidatedCast.h @@ -34,5 +34,5 @@ DstType* ValidatedCast( SrcType *Ptr ) CHECK_DYNAMIC_TYPE( DstType, Ptr ); } #endif - return static_cast( Ptr ); + return Ptr != nullptr ? static_cast( Ptr ) : nullptr; } -- cgit v1.2.3