chore: ArchNetworkBSD:Deps use make_shared now that we dont build on ubuntu 22 anymore

This commit is contained in:
sithlord48
2025-06-19 18:59:56 -04:00
committed by Nick Bolton
parent f4a49749c7
commit 0321b2d36e

View File

@ -73,10 +73,7 @@ int ArchNetworkBSD::Deps::poll(struct pollfd *fds, nfds_t nfds, int timeout)
std::shared_ptr<struct pollfd[]> ArchNetworkBSD::Deps::makePollFD(nfds_t n)
{
// C++20 supports std::make_shared<struct pollfd[]>(n) but this is not
// implemented on the compiler that comes with Ubuntu 22 and a few other
// distros, so use the manual new and delete until we drop those distros.
return std::shared_ptr<struct pollfd[]>(new struct pollfd[n], std::default_delete<struct pollfd[]>());
return std::make_shared<struct pollfd[]>(n);
}
ssize_t ArchNetworkBSD::Deps::read(int fd, void *buf, size_t len)