AK: Add cast using objective-c __bridge qualifier

This commit is contained in:
Andrew Kaster 2025-03-16 17:08:40 -06:00 committed by Andrew Kaster
parent 0c2f434e69
commit be84ff4f2c
Notes: github-actions[bot] 2025-03-18 23:16:23 +00:00

View file

@ -73,10 +73,21 @@ ALWAYS_INLINE CopyConst<InputType, OutputType>* as(InputType* input)
return result;
}
template<typename OutputType, typename InputType>
ALWAYS_INLINE CopyConst<InputType, OutputType>* bridge_cast(InputType input)
{
#ifdef AK_HAS_OBJC_ARC
return (__bridge CopyConst<InputType, OutputType>*)(input);
#else
return static_cast<CopyConst<InputType, OutputType>*>(input);
#endif
}
}
#if USING_AK_GLOBALLY
using AK::as;
using AK::as_if;
using AK::bridge_cast;
using AK::is;
#endif