summaryrefslogtreecommitdiffstats
path: root/Common/interface
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-03-22 04:24:57 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-03-22 04:24:57 +0000
commitb40eac41b528d3ec668ba7032d590684100d1488 (patch)
tree26009b6bf2e639fb2ed8a293ab0e15603bb1fa83 /Common/interface
parentWindowsFileSystem: added GetCurrentDirectory and GetRelativePath functions (diff)
downloadDiligentCore-b40eac41b528d3ec668ba7032d590684100d1488.tar.gz
DiligentCore-b40eac41b528d3ec668ba7032d590684100d1488.zip
Fixed latest MSVC (19.25.28610.4) build issue
Diffstat (limited to 'Common/interface')
-rw-r--r--Common/interface/RefCountedObjectImpl.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Common/interface/RefCountedObjectImpl.hpp b/Common/interface/RefCountedObjectImpl.hpp
index 5ce5453f..c437f170 100644
--- a/Common/interface/RefCountedObjectImpl.hpp
+++ b/Common/interface/RefCountedObjectImpl.hpp
@@ -469,7 +469,15 @@ private:
RefCountersImpl& operator = (RefCountersImpl&&) = delete;
// clang-format on
- static constexpr size_t ObjectWrapperBufferSize = sizeof(ObjectWrapper<IObject, IMemoryAllocator>) / sizeof(size_t);
+ struct IObjectStub : public IObject
+ {
+ virtual ~IObjectStub() = 0;
+ };
+ // MSVC starting with 19.25.28610.4 fails to compile sizeof(ObjectWrapper<IObject, IMemoryAllocator>) because
+ // IObject does not have virtual destructor. The compiler is technically right, so we use IObjectStub,
+ // which does have virtual destructor.
+ static constexpr size_t ObjectWrapperBufferSize = sizeof(ObjectWrapper<IObjectStub, IMemoryAllocator>) / sizeof(size_t);
+
size_t m_ObjectWrapperBuffer[ObjectWrapperBufferSize];
Atomics::AtomicLong m_lNumStrongReferences;
Atomics::AtomicLong m_lNumWeakReferences;