summaryrefslogtreecommitdiff
path: root/slang.h
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2022-08-26 20:32:53 -0400
committerGitHub <noreply@github.com>2022-08-26 20:32:53 -0400
commit5c2c2cfc9918bb43225159e67a851e196e17759a (patch)
tree216009d02afe9dc17b074fdd394141ef71472268 /slang.h
parentef067bef2f2188a4b3c420cbcd8d223874888ed2 (diff)
DownstreamCompileOptions using POD types (#2381)
* #include an absolute path didn't work - because paths were taken to always be relative. * Make DownstreamCompileOptions use POD types. * CharSliceAllocator -> SliceAllocator Added SliceConverter CharSliceCaster -> SliceCaster * First attempt at zero terminating around blobs. * Fix clang warning. * Add SlangTerminatedChars Make Blob implementations support it. Make most blobs 'terminated'. * Fix bug setting up sourceFiles for CommandLineDownstreamCompiler. * Traffic in TerminatedCharSlice for sourceFiles. Use ArtifactDesc to generate temporary file names for source. * Fix typo in testing for shared library/C++.
Diffstat (limited to 'slang.h')
-rw-r--r--slang.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/slang.h b/slang.h
index 53ab0c70a..a224bf6f6 100644
--- a/slang.h
+++ b/slang.h
@@ -980,6 +980,15 @@ extern "C"
};
#define SLANG_UUID_ISlangBlob ISlangBlob::getTypeGuid()
+ /* Can be requested from ISlangCastable cast to indicate the contained chars are null terminated.
+ */
+ struct SlangTerminatedChars
+ {
+ SLANG_CLASS_GUID(0xbe0db1a8, 0x3594, 0x4603, { 0xa7, 0x8b, 0xc4, 0x86, 0x84, 0x30, 0xdf, 0xbb });
+ operator const char*() const { return chars; }
+ char chars[1];
+ };
+
/** A (real or virtual) file system.
Slang can make use of this interface whenever it would otherwise try to load files