AK: Add cast using objective-c __bridge qualifier
This commit is contained in:
parent
0c2f434e69
commit
be84ff4f2c
1 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue