summaryrefslogtreecommitdiffstats
path: root/Common/include
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2017-11-17 03:38:10 +0000
committerEgor Yusov <egor.yusov@gmail.com>2017-11-17 03:38:10 +0000
commit68db615cd5f5ef731ca7018b251b43106c5a9f47 (patch)
treecd135e3fde86ff21a0329cbb9ea84fc5394e4ca2 /Common/include
parentUpdate readme.md (diff)
downloadDiligentCore-68db615cd5f5ef731ca7018b251b43106c5a9f47.tar.gz
DiligentCore-68db615cd5f5ef731ca7018b251b43106c5a9f47.zip
Fixed Android build issues
Diffstat (limited to 'Common/include')
-rw-r--r--Common/include/DebugUtilities.h4
-rw-r--r--Common/include/FixedBlockMemoryAllocator.h2
-rw-r--r--Common/include/ValidatedCast.h2
3 files changed, 5 insertions, 3 deletions
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 <typeinfo>
+
// 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<typename DstType, typename SrcType>
void CheckDynamicType( SrcType *pSrcPtr )
{
- VERIFY( pSrcPtr == nullptr || dynamic_cast<DstType*> (pSrcPtr) != nullptr, "Dynamic type cast failed!" );
+ VERIFY(pSrcPtr == nullptr || dynamic_cast<DstType*> (pSrcPtr) != nullptr, "Dynamic type cast failed. Src typeid: \'", typeid(*pSrcPtr).name(), "\' Dst typeid: \'", typeid(DstType).name(), '\'');
}
# define CHECK_DYNAMIC_TYPE(DstType, pSrcPtr) CheckDynamicType<DstType>(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<MemoryPage, STDAllocatorRawMem<MemoryPage> > m_PagePool;
std::unordered_set<size_t, std::hash<size_t>, std::equal_to<size_t>, STDAllocatorRawMem<size_t> > m_AvailablePages;
- typedef std::pair<void*, size_t> AddrToPageIdMapElem;
+ typedef std::pair<void* const, size_t> AddrToPageIdMapElem;
std::unordered_map<void*, size_t, std::hash<void*>, std::equal_to<void*>, STDAllocatorRawMem<AddrToPageIdMapElem> > 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<DstType*>( Ptr );
+ return Ptr != nullptr ? static_cast<DstType*>( Ptr ) : nullptr;
}