diff options
Diffstat (limited to 'prelude')
| -rw-r--r-- | prelude/slang-cpp-prelude.h | 4 | ||||
| -rw-r--r-- | prelude/slang-cuda-prelude.h | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/prelude/slang-cpp-prelude.h b/prelude/slang-cpp-prelude.h index 15d200d2f..77c738620 100644 --- a/prelude/slang-cpp-prelude.h +++ b/prelude/slang-cpp-prelude.h @@ -22,6 +22,10 @@ #define SLANG_PRELUDE_EXPORT SLANG_PRELUDE_EXTERN_C SLANG_PRELUDE_SHARED_LIB_EXPORT +#ifndef SLANG_INFINITY +# define SLANG_INFINITY INFINITY +#endif + #include "slang-cpp-types.h" #include "slang-cpp-scalar-intrinsics.h" diff --git a/prelude/slang-cuda-prelude.h b/prelude/slang-cuda-prelude.h index 233903134..edfa9b5e0 100644 --- a/prelude/slang-cuda-prelude.h +++ b/prelude/slang-cuda-prelude.h @@ -1,4 +1,9 @@ +// Must be large enough to cause overflow and therefore infinity +#ifndef SLANG_INFINITY +# define SLANG_INFINITY ((float)(1e+300 * 1e+300)) +#endif + // For now we'll disable any asserts in this prelude #define SLANG_PRELUDE_ASSERT(x) |
