summaryrefslogtreecommitdiffstats
path: root/source/core/slang-blob.cpp
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2021-04-01 18:59:24 -0400
committerGitHub <noreply@github.com>2021-04-01 15:59:24 -0700
commit9475b11045089c9bc9773b16f7eb84f843db70c4 (patch)
treef2855e1283a3811fd771d646f6e2532ca9cb5e21 /source/core/slang-blob.cpp
parent2a32fae2ca766862ad76973ab37605edf9ec0faa (diff)
Associating GUID (or UUID) with types (#1776)
* #include an absolute path didn't work - because paths were taken to always be relative. * Add mechanism to embed guid inside of type.
Diffstat (limited to 'source/core/slang-blob.cpp')
-rw-r--r--source/core/slang-blob.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/source/core/slang-blob.cpp b/source/core/slang-blob.cpp
index becccf51c..569991508 100644
--- a/source/core/slang-blob.cpp
+++ b/source/core/slang-blob.cpp
@@ -2,18 +2,14 @@
namespace Slang {
-// Allocate static const storage for the various interface IDs that the Slang API needs to expose
-static const Guid IID_ISlangUnknown = SLANG_UUID_ISlangUnknown;
-static const Guid IID_ISlangBlob = SLANG_UUID_ISlangBlob;
-
ISlangUnknown* BlobBase::getInterface(const Guid& guid)
{
- return (guid == IID_ISlangUnknown || guid == IID_ISlangBlob) ? static_cast<ISlangBlob*>(this) : nullptr;
+ return (guid == ISlangUnknown::getTypeGuid() || guid == ISlangBlob::getTypeGuid()) ? static_cast<ISlangBlob*>(this) : nullptr;
}
SlangResult StaticBlob::queryInterface(SlangUUID const& guid, void** outObject)
{
- if (guid == IID_ISlangUnknown || guid == IID_ISlangBlob)
+ if (guid == ISlangUnknown::getTypeGuid() || guid == ISlangBlob::getTypeGuid())
{
*outObject = static_cast<ISlangBlob*>(this);
return SLANG_OK;