[*] ...linux

This commit is contained in:
Reece Wilson 2021-10-02 15:05:35 +01:00
parent 86e556a9bb
commit 540c5826d8
2 changed files with 4 additions and 4 deletions

View File

@ -516,7 +516,7 @@ namespace Aurora::Async
}
};
#define ASYNC_ERROR(exp) if constexpr (std::is_same_v<T, bool>) { SysPushErrorGen(exp); return {}; } else { throw std::exception(exp); }
#define ASYNC_ERROR(exp) if constexpr (std::is_same_v<T, bool>) { SysPushErrorGen(exp); return {}; } else { throw std::string(exp); }
#define ASYNC_FINISH if constexpr (std::is_same_v<T, bool>) { return true; }
template<typename T = void, typename... Args, AU_TEMPLATE_ENABLE_WHEN(std::is_same_v<T, bool> || std::is_void<T>::value)>
@ -548,7 +548,7 @@ namespace Aurora::Async
{
auto work = AuMakeShared<BasicWorkCallback<AVoid, B>>();
if (!work) ASYNC_ERROR("can't dispatch async call; out of memory");
work.task.onProcess = [](const AVoid &) -> AuOptional<B>
work.task.onProcess = [=](const AVoid &) -> AuOptional<B>
{
return func(in...);
};

View File

@ -53,14 +53,14 @@ namespace Aurora::Memory
T *NewArray(Types::size_t count)
{
static_assert(!std::is_class<T>::value, "Do not use heap/kmem apis with classes");
return FAlloc<T *>(count * sizeof(T));
return reinterpret_cast<T *>(_FAlloc(count * sizeof(T)));
}
template<typename T>
T *NewArray(Types::size_t count, Types::size_t align)
{
static_assert(!std::is_class<T>::value, "Do not use heap/kmem apis with classes");
return FAlloc<T *>(count * sizeof(T), align);
return reinterpret_cast<T *>(_FAlloc(count * sizeof(T)), align);
}
template<typename T>