From 0468cd0d1a8a1cff1d838a741b050ef11f6d7461 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Sat, 8 Apr 2023 01:11:27 +0800 Subject: Add SLANG_IID_PPV_ARGS (#2784) * Add SLANG_IID_PPV_ARGS To mirror IID_PPV_ARGS from the COM Coding Practices: https://learn.microsoft.com/en-us/windows/win32/LearnWin32/com-coding-practices#the-iid_ppv_args-macro * Make getTypeGuid constexpr --------- Co-authored-by: Yong He --- source/slang/slang.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/slang/slang.cpp') diff --git a/source/slang/slang.cpp b/source/slang/slang.cpp index 283e7c16e..2f02dcfb7 100644 --- a/source/slang/slang.cpp +++ b/source/slang/slang.cpp @@ -3393,7 +3393,7 @@ ComponentType* asInternal(slang::IComponentType* inComponentType) // (without even `addRef`-ing it). // ComPtr componentType; - inComponentType->queryInterface(slang::IComponentType::getTypeGuid(), (void**) componentType.writeRef()); + inComponentType->queryInterface(SLANG_IID_PPV_ARGS(componentType.writeRef())); return static_cast(componentType.get()); } @@ -4454,7 +4454,7 @@ void Linkage::setFileSystem(ISlangFileSystem* inFileSystem) else { // See if we have the full ISlangFileSystemExt interface, if we do just use it - inFileSystem->queryInterface(ISlangFileSystemExt::getTypeGuid(), (void**)m_fileSystemExt.writeRef()); + inFileSystem->queryInterface(SLANG_IID_PPV_ARGS(m_fileSystemExt.writeRef())); // If not wrap with CacheFileSystem that emulates ISlangFileSystemExt from the ISlangFileSystem interface if (!m_fileSystemExt) -- cgit v1.2.3