summaryrefslogtreecommitdiff
path: root/prelude/slang-cpp-prelude.h
diff options
context:
space:
mode:
Diffstat (limited to 'prelude/slang-cpp-prelude.h')
-rw-r--r--prelude/slang-cpp-prelude.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/prelude/slang-cpp-prelude.h b/prelude/slang-cpp-prelude.h
index ffd18cf32..76ff16590 100644
--- a/prelude/slang-cpp-prelude.h
+++ b/prelude/slang-cpp-prelude.h
@@ -5,17 +5,22 @@
// to use the version in the std namespace.
// https://stackoverflow.com/questions/39130040/cmath-hides-isnan-in-math-h-in-c14-c11
-#if SLANG_GCC_FAMILY && __GNUC__ < 6
-# include <cmath>
-# define SLANG_PRELUDE_STD std::
-#else
-# include <math.h>
-# define SLANG_PRELUDE_STD
-#endif
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
+#ifdef SLANG_LLVM
+# include "slang-llvm.h"
+#else // SLANG_LLVM
+# if SLANG_GCC_FAMILY && __GNUC__ < 6
+# include <cmath>
+# define SLANG_PRELUDE_STD std::
+# else
+# include <math.h>
+# define SLANG_PRELUDE_STD
+# endif
+
+# include <assert.h>
+# include <stdlib.h>
+# include <string.h>
+# include <stdint.h>
+#endif // SLANG_LLVM
#if defined(_MSC_VER)
# define SLANG_PRELUDE_SHARED_LIB_EXPORT __declspec(dllexport)
@@ -26,8 +31,12 @@
#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
#define SLANG_PRELUDE_EXPORT SLANG_PRELUDE_EXTERN_C SLANG_PRELUDE_SHARED_LIB_EXPORT