summaryrefslogtreecommitdiff
path: root/source/slang-rt
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 /source/slang-rt
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 'source/slang-rt')
-rw-r--r--source/slang-rt/slang-rt.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang-rt/slang-rt.h b/source/slang-rt/slang-rt.h
index b6f397c72..3941b3acc 100644
--- a/source/slang-rt/slang-rt.h
+++ b/source/slang-rt/slang-rt.h
@@ -4,6 +4,7 @@
#include "../core/slang-string.h"
#include "../core/slang-smart-pointer.h"
+#include "../core/slang-com-object.h"
#ifdef SLANG_RT_DYNAMIC_EXPORT
# define SLANG_RT_API SLANG_DLL_EXPORT
@@ -11,6 +12,15 @@
# define SLANG_RT_API
#endif
+#if defined(_MSC_VER)
+# define SLANG_PRELUDE_SHARED_LIB_EXPORT __declspec(dllexport)
+#else
+# define SLANG_PRELUDE_SHARED_LIB_EXPORT __attribute__((__visibility__("default")))
+//# define SLANG_PRELUDE_SHARED_LIB_EXPORT __attribute__ ((dllexport)) __attribute__((__visibility__("default")))
+#endif
+
+#define SLANG_PRELUDE_EXPORT extern "C" SLANG_PRELUDE_SHARED_LIB_EXPORT
+
extern "C"
{
SLANG_RT_API void SLANG_MCALL _slang_rt_abort(Slang::String errorMessage);