From 029672ee08f5ecb710e84cf1ccc625e826ff9a29 Mon Sep 17 00:00:00 2001 From: Julius Ikkala Date: Sat, 10 May 2025 01:50:14 +0300 Subject: Fix various intptr_t issues by defining its width in `getIntTypeInfo` (#6786) * Define a bit size for the intptr types * Fix intptr_t sign * Extend intptr test to check for previously broken operations * Fix intptr vector test on CUDA * Handle intptr size in getAnyValueSize * Fix formatting * Try with __ARM_ARCH_ISA_64 * On macs, int64_t != intptr_t Yikes * Move define to prelude header * Also check apple in host-prelude * Fix define location --- source/slang/slang-ir-any-value-marshalling.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/slang/slang-ir-any-value-marshalling.cpp') diff --git a/source/slang/slang-ir-any-value-marshalling.cpp b/source/slang/slang-ir-any-value-marshalling.cpp index b3bcf3316..9fb414db1 100644 --- a/source/slang/slang-ir-any-value-marshalling.cpp +++ b/source/slang/slang-ir-any-value-marshalling.cpp @@ -862,11 +862,19 @@ SlangInt _getAnyValueSizeRaw(IRType* type, SlangInt offset) case kIROp_FloatType: case kIROp_UIntType: case kIROp_BoolType: +#if SLANG_PTR_IS_32 + case kIROp_IntPtrType: + case kIROp_UIntPtrType: +#endif return alignUp(offset, 4) + 4; case kIROp_UInt64Type: case kIROp_Int64Type: case kIROp_DoubleType: case kIROp_PtrType: +#if SLANG_PTR_IS_64 + case kIROp_IntPtrType: + case kIROp_UIntPtrType: +#endif return alignUp(offset, 8) + 8; case kIROp_Int16Type: case kIROp_UInt16Type: -- cgit v1.2.3