mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 03:55:24 +00:00
AK: Add cast using objective-c __bridge qualifier
This commit is contained in:
parent
0c2f434e69
commit
be84ff4f2c
Notes:
github-actions[bot]
2025-03-18 23:16:23 +00:00
Author: https://github.com/ADKaster Commit: https://github.com/LadybirdBrowser/ladybird/commit/be84ff4f2c7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3963 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/bugaevc
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…
Add table
Reference in a new issue