mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 12:24:16 +00:00
Fix build against macOS deployment target 10.10
- std::optional<T>::value() is not available, use operator * instead - alignment allocation is also only available in 10.14 or newer
This commit is contained in:
parent
18253b5150
commit
0ba6ef1c24
4 changed files with 14 additions and 4 deletions
|
|
@ -147,7 +147,7 @@ public:
|
|||
template<typename Component>
|
||||
void set_component(const Component &c) const
|
||||
{
|
||||
auto self_rc = c.self_weak.lock().value().into_dyn();
|
||||
auto self_rc = (*c.self_weak.lock()).into_dyn();
|
||||
slint_windowrc_set_component(&inner, &self_rc);
|
||||
}
|
||||
|
||||
|
|
@ -289,8 +289,10 @@ inline void dealloc(const ComponentVTable *, uint8_t *ptr, vtable::Layout layout
|
|||
#ifdef __cpp_sized_deallocation
|
||||
::operator delete(reinterpret_cast<void *>(ptr), layout.size,
|
||||
static_cast<std::align_val_t>(layout.align));
|
||||
#else
|
||||
#elif !defined(__APPLE__) || MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_14
|
||||
::operator delete(reinterpret_cast<void *>(ptr), static_cast<std::align_val_t>(layout.align));
|
||||
#else
|
||||
::operator delete(reinterpret_cast<void *>(ptr));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue