diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2021-09-10 16:31:26 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-10 13:31:26 -0700 |
| commit | 27ce5eb0de9f792f3e433bcb239c07d79371cf45 (patch) | |
| tree | bb85155ceafd280a3931432141fc1cc1dae20959 /prelude/slang-cpp-prelude.h | |
| parent | 28adf8917e53953dbfebd746410a427a55eed814 (diff) | |
First Slang LLVM integration (#1934)
* #include an absolute path didn't work - because paths were taken to always be relative.
* First integration with 'slang-llvm'.
* Fix project.
* Fix test output.
* First pass assert support.
* Add inline impls for min and max.
* Add abs inline abs impl for llvm.
* Make abs not use ternary op
* Fix typo in slang-llvm.h
* Sundary fixes to make remaining tests using llvm backend pass.
Diffstat (limited to 'prelude/slang-cpp-prelude.h')
| -rw-r--r-- | prelude/slang-cpp-prelude.h | 31 |
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 |
