summaryrefslogtreecommitdiff
path: root/prelude
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-07-25 10:08:28 -0700
committerGitHub <noreply@github.com>2022-07-25 10:08:28 -0700
commit9566e8af25f87ad034a984db9d847942e454a180 (patch)
tree2f295bf2bf60c39fd35b6b634b903d574b4ca99e /prelude
parent70147fc7ba6abe0b669363ed5adfd8d4d9545c3f (diff)
Allow `class` to implement COM interface, [DLLExport] (#2338)
* Allow `class` to implement COM interface, [DLLExport] * Fix [COM] usage in tests and examples with UUIDs. Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'prelude')
-rw-r--r--prelude/slang-cpp-prelude.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/prelude/slang-cpp-prelude.h b/prelude/slang-cpp-prelude.h
index 0381a7bb6..a91019d15 100644
--- a/prelude/slang-cpp-prelude.h
+++ b/prelude/slang-cpp-prelude.h
@@ -40,6 +40,8 @@
#endif
#define SLANG_PRELUDE_EXPORT SLANG_PRELUDE_EXTERN_C SLANG_PRELUDE_SHARED_LIB_EXPORT
+#define SLANG_PRELUDE_EXPORT_START SLANG_PRELUDE_EXTERN_C_START SLANG_PRELUDE_SHARED_LIB_EXPORT
+#define SLANG_PRELUDE_EXPORT_END SLANG_PRELUDE_EXTERN_C_END SLANG_PRELUDE_SHARED_LIB_EXPORT
#ifndef SLANG_INFINITY
# define SLANG_INFINITY INFINITY
@@ -272,6 +274,13 @@ struct ISlangUnknown
virtual SLANG_NO_THROW uint32_t SLANG_MCALL release() = 0;
};
+#define SLANG_COM_INTERFACE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
+ public: \
+ SLANG_FORCE_INLINE static const SlangUUID& getTypeGuid() \
+ { \
+ static const SlangUUID guid = { a, b, c, d0, d1, d2, d3, d4, d5, d6, d7 }; \
+ return guid; \
+ }
#endif // SLANG_H
// Includes
@@ -288,4 +297,4 @@ struct ISlangUnknown
# define SLANG_UNROLL
#endif
-#endif \ No newline at end of file
+#endif