From e807e32b1aee1daff61b8ebf61f7b38bd895a8c9 Mon Sep 17 00:00:00 2001 From: lizzie Date: Fri, 15 Aug 2025 04:12:45 +0200 Subject: [compat] fix solaris Qt build (#194) Co-authored-by: crueter Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/194 Reviewed-by: crueter Co-authored-by: lizzie Co-committed-by: lizzie --- src/common/host_memory.cpp | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'src/common/host_memory.cpp') diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 9e34cd3ac6..949cd188f3 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -442,16 +442,15 @@ static int shm_open_anon(int flags, mode_t mode) { for (char *fill = start; fill < limit; r /= 8) *fill++ = '0' + (r % 8); int fd = shm_open(name, flags, mode); - if (fd != -1) - return ([](const char *name, int fd) { - if (shm_unlink(name) == -1) { - int tmp = errno; - close(fd); - errno = tmp; - return -1; - } - return fd; - })(name, fd); + if (fd != -1) { + if (shm_unlink(name) == -1) { + int tmp = errno; + close(fd); + errno = tmp; + return -1; + } + return fd; + } if (errno != EEXIST) break; } @@ -464,15 +463,13 @@ static int shm_open_anon(int flags, mode_t mode) { int fd; if ((fd = shm_mkstemp(name)) == -1) return -1; - return ([](const char *name, int fd) { - if (shm_unlink(name) == -1) { - int tmp = errno; - close(fd); - errno = tmp; - return -1; - } - return fd; - })(name, fd); + if (shm_unlink(name) == -1) { + int tmp = errno; + close(fd); + errno = tmp; + return -1; + } + return fd; } #endif -- cgit v1.2.3