summaryrefslogtreecommitdiffstats
path: root/source/core/slang-common.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2022-03-28 22:14:33 -0700
committerGitHub <noreply@github.com>2022-03-28 22:14:33 -0700
commit255fd5873f65a6b01d5385c277d55612dc3cc587 (patch)
tree54eda0ae98bc9c1b30ca75e534ca203d8e03f241 /source/core/slang-common.h
parent79b81083b75dc0abdbb8184568dbe36d082e04f3 (diff)
Allow slangc to generate exe from .slang file. (#2170)
Diffstat (limited to 'source/core/slang-common.h')
-rw-r--r--source/core/slang-common.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/core/slang-common.h b/source/core/slang-common.h
index f17660e0d..694162f1d 100644
--- a/source/core/slang-common.h
+++ b/source/core/slang-common.h
@@ -94,3 +94,22 @@ template<typename T> void slang_use_obj(T&) {}
#define SLANG_UNREFERENCED_PARAMETER(P) slang_use_obj(P)
#define SLANG_UNREFERENCED_VARIABLE(P) slang_use_obj(P)
#endif
+
+#if defined(SLANG_RT_DYNAMIC)
+#if defined(_MSC_VER)
+# ifdef SLANG_RT_DYNAMIC_EXPORT
+# define SLANG_RT_API SLANG_DLL_EXPORT
+# else
+# define SLANG_RT_API __declspec(dllimport)
+# endif
+#else
+// TODO: need to consider compiler capabilities
+//# ifdef SLANG_RT_DYNAMIC_EXPORT
+# define SLANG_RT_API SLANG_DLL_EXPORT
+//# endif
+#endif
+#endif
+
+#ifndef SLANG_RT_API
+#define SLANG_RT_API
+#endif