mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09: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: be84ff4f2c
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;
|
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
|
#if USING_AK_GLOBALLY
|
||||||
using AK::as;
|
using AK::as;
|
||||||
using AK::as_if;
|
using AK::as_if;
|
||||||
|
using AK::bridge_cast;
|
||||||
using AK::is;
|
using AK::is;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue