diff options
Diffstat (limited to 'prelude')
| -rw-r--r-- | prelude/slang-cpp-host-prelude.h | 7 | ||||
| -rw-r--r-- | prelude/slang-cpp-prelude.h | 7 | ||||
| -rw-r--r-- | prelude/slang-cpp-types-core.h | 16 |
3 files changed, 30 insertions, 0 deletions
diff --git a/prelude/slang-cpp-host-prelude.h b/prelude/slang-cpp-host-prelude.h index 8bc0f5cad..66f74052c 100644 --- a/prelude/slang-cpp-host-prelude.h +++ b/prelude/slang-cpp-host-prelude.h @@ -28,6 +28,13 @@ #include <string.h> #endif // SLANG_LLVM +// Is intptr_t not equal to equal-width sized integer type? +#if defined(__APPLE__) +#define SLANG_INTPTR_TYPE_IS_DISTINCT 1 +#else +#define SLANG_INTPTR_TYPE_IS_DISTINCT 0 +#endif + #if defined(_MSC_VER) #define SLANG_PRELUDE_SHARED_LIB_EXPORT __declspec(dllexport) #else diff --git a/prelude/slang-cpp-prelude.h b/prelude/slang-cpp-prelude.h index 4dacac9c5..6530654c1 100644 --- a/prelude/slang-cpp-prelude.h +++ b/prelude/slang-cpp-prelude.h @@ -22,6 +22,13 @@ #include <string.h> #endif // SLANG_LLVM +// Is intptr_t not equal to equal-width sized integer type? +#if defined(__APPLE__) +#define SLANG_INTPTR_TYPE_IS_DISTINCT 1 +#else +#define SLANG_INTPTR_TYPE_IS_DISTINCT 0 +#endif + #if defined(_MSC_VER) #define SLANG_PRELUDE_SHARED_LIB_EXPORT __declspec(dllexport) #else diff --git a/prelude/slang-cpp-types-core.h b/prelude/slang-cpp-types-core.h index 82674fefb..5f2024ac7 100644 --- a/prelude/slang-cpp-types-core.h +++ b/prelude/slang-cpp-types-core.h @@ -346,6 +346,10 @@ SLANG_INT_VECTOR_OPS(uint) SLANG_INT_VECTOR_OPS(uint8_t) SLANG_INT_VECTOR_OPS(uint16_t) SLANG_INT_VECTOR_OPS(uint64_t) +#if SLANG_INTPTR_TYPE_IS_DISTINCT +SLANG_INT_VECTOR_OPS(intptr_t) +SLANG_INT_VECTOR_OPS(uintptr_t) +#endif SLANG_FLOAT_VECTOR_OPS(float) SLANG_FLOAT_VECTOR_OPS(double) @@ -367,6 +371,10 @@ SLANG_VECTOR_INT_NEG_OP(uint) SLANG_VECTOR_INT_NEG_OP(uint8_t) SLANG_VECTOR_INT_NEG_OP(uint16_t) SLANG_VECTOR_INT_NEG_OP(uint64_t) +#if SLANG_INTPTR_TYPE_IS_DISTINCT +SLANG_VECTOR_INT_NEG_OP(intptr_t) +SLANG_VECTOR_INT_NEG_OP(uintptr_t) +#endif #define SLANG_FLOAT_VECTOR_MOD(T) \ template<int N> \ @@ -643,6 +651,10 @@ SLANG_INT_MATRIX_OPS(uint) SLANG_INT_MATRIX_OPS(uint8_t) SLANG_INT_MATRIX_OPS(uint16_t) SLANG_INT_MATRIX_OPS(uint64_t) +#if SLANG_INTPTR_TYPE_IS_DISTINCT +SLANG_INT_MATRIX_OPS(intptr_t) +SLANG_INT_MATRIX_OPS(uintptr_t) +#endif SLANG_FLOAT_MATRIX_OPS(float) SLANG_FLOAT_MATRIX_OPS(double) @@ -665,6 +677,10 @@ SLANG_MATRIX_INT_NEG_OP(uint) SLANG_MATRIX_INT_NEG_OP(uint8_t) SLANG_MATRIX_INT_NEG_OP(uint16_t) SLANG_MATRIX_INT_NEG_OP(uint64_t) +#if SLANG_INTPTR_TYPE_IS_DISTINCT +SLANG_MATRIX_INT_NEG_OP(intptr_t) +SLANG_MATRIX_INT_NEG_OP(uintptr_t) +#endif #define SLANG_FLOAT_MATRIX_MOD(T) \ template<int R, int C> \ |
