mirror of
https://gitlab.com/suyu-emu/suyu.git
synced 2024-03-15 23:15:44 +00:00
host_memory: Add workaround for FreeBSD 12
src/common/host_memory.cpp:360:14: error: use of undeclared identifier 'memfd_create' fd = memfd_create("HostMemory", 0); ^
This commit is contained in:
parent
c4cd82fa7c
commit
353be2306c
|
@ -357,7 +357,12 @@ public:
|
||||||
});
|
});
|
||||||
|
|
||||||
// Backing memory initialization
|
// Backing memory initialization
|
||||||
|
#if defined(__FreeBSD__) && __FreeBSD__ < 13
|
||||||
|
// XXX Drop after FreeBSD 12.* reaches EOL on 2024-06-30
|
||||||
|
fd = shm_open(SHM_ANON, O_RDWR, 0600);
|
||||||
|
#else
|
||||||
fd = memfd_create("HostMemory", 0);
|
fd = memfd_create("HostMemory", 0);
|
||||||
|
#endif
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
LOG_CRITICAL(HW_Memory, "memfd_create failed: {}", strerror(errno));
|
LOG_CRITICAL(HW_Memory, "memfd_create failed: {}", strerror(errno));
|
||||||
throw std::bad_alloc{};
|
throw std::bad_alloc{};
|
||||||
|
|
Loading…
Reference in a new issue