summaryrefslogtreecommitdiff
path: root/prelude/slang-cpp-host-prelude.h
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-05-09 18:00:48 -0700
committerGitHub <noreply@github.com>2023-05-09 18:00:48 -0700
commitddebd60853b3f34bfd8e89de804fd15808abf75d (patch)
treed5d686843bc2c67e493693376a0170857998c077 /prelude/slang-cpp-host-prelude.h
parent38ed03a7203baacf36fca62539ac74fd45ed42d2 (diff)
Various fixes for autodiff and slangpy. (#2876)
* Various fixes for autodiff and slangpy. * Fix cuda code gen for `select`. * Fix getBuildTagString(). * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'prelude/slang-cpp-host-prelude.h')
-rw-r--r--prelude/slang-cpp-host-prelude.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/prelude/slang-cpp-host-prelude.h b/prelude/slang-cpp-host-prelude.h
index 0a026471c..f69d03eed 100644
--- a/prelude/slang-cpp-host-prelude.h
+++ b/prelude/slang-cpp-host-prelude.h
@@ -28,6 +28,22 @@
# include <stdint.h>
#endif // SLANG_LLVM
+#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
+
+#ifdef __cplusplus
+# define SLANG_PRELUDE_EXTERN_C extern "C"
+# define SLANG_PRELUDE_EXTERN_C_START extern "C" {
+# define SLANG_PRELUDE_EXTERN_C_END }
+#else
+# define SLANG_PRELUDE_EXTERN_C
+# define SLANG_PRELUDE_EXTERN_C_START
+# define SLANG_PRELUDE_EXTERN_C_END
+#endif
#include "slang-cpp-scalar-intrinsics.h"