summaryrefslogtreecommitdiffstats
path: root/source/slang
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-04-08 01:11:27 +0800
committerGitHub <noreply@github.com>2023-04-07 10:11:27 -0700
commit0468cd0d1a8a1cff1d838a741b050ef11f6d7461 (patch)
treee2e9e5731a20f46d524562c932a2371b191fd4e6 /source/slang
parent7bbe7b4780345181cb586b03504ff63f9b8d5c4c (diff)
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 <yonghe@outlook.com>
Diffstat (limited to 'source/slang')
-rwxr-xr-xsource/slang/slang-compiler.h2
-rw-r--r--source/slang/slang.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/source/slang/slang-compiler.h b/source/slang/slang-compiler.h
index 895834312..52d154e5c 100755
--- a/source/slang/slang-compiler.h
+++ b/source/slang/slang-compiler.h
@@ -3114,7 +3114,7 @@ SLANG_FORCE_INLINE EndToEndCompileRequest* asInternal(SlangCompileRequest* reque
SLANG_ASSERT(request);
EndToEndCompileRequest* endToEndRequest = nullptr;
// NOTE! We aren't using to access an interface, so *doesn't* return with a refcount
- request->queryInterface(EndToEndCompileRequest::getTypeGuid(), (void**)&endToEndRequest);
+ request->queryInterface(SLANG_IID_PPV_ARGS(&endToEndRequest));
SLANG_ASSERT(endToEndRequest);
return endToEndRequest;
}
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<slang::IComponentType> componentType;
- inComponentType->queryInterface(slang::IComponentType::getTypeGuid(), (void**) componentType.writeRef());
+ inComponentType->queryInterface(SLANG_IID_PPV_ARGS(componentType.writeRef()));
return static_cast<ComponentType*>(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)