diff --git a/source/utils/CarlaShmUtils.hpp b/source/utils/CarlaShmUtils.hpp index 1d45b23b3..71ca6f0f7 100644 --- a/source/utils/CarlaShmUtils.hpp +++ b/source/utils/CarlaShmUtils.hpp @@ -27,7 +27,7 @@ struct carla_shm_t { HANDLE map; bool isServer; const char* filename; }; # ifndef __WINE__ # include # endif -# ifdef CARLA_OS_HAIKU +# ifndef CARLA_OS_LINUX # define MAP_LOCKED 0x0 # endif # include @@ -197,11 +197,7 @@ void* carla_shm_map(carla_shm_t& shm, const std::size_t size) noexcept CARLA_SAFE_ASSERT_RETURN(ret == 0, nullptr); } -# ifdef CARLA_OS_MAC - void* const ptr(::mmap(nullptr, size, PROT_READ|PROT_WRITE, MAP_SHARED, shm.fd, 0)); -# else void* const ptr(::mmap(nullptr, size, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED, shm.fd, 0)); -# endif if (ptr == nullptr) { @@ -346,8 +342,12 @@ bool carla_shm_map(carla_shm_t& shm, T*& value) noexcept return (value != nullptr); } +#endif // __WINE__ + // ----------------------------------------------------------------------- -#endif // __WINE__ +#ifndef CARLA_OS_LINUX +# undef MAP_LOCKED +#endif #endif // CARLA_SHM_UTILS_HPP_INCLUDED