From 9566e8af25f87ad034a984db9d847942e454a180 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 25 Jul 2022 10:08:28 -0700 Subject: 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 --- source/slang-rt/slang-rt.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/slang-rt') 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); -- cgit v1.2.3