fix(freebsd): include semaphore_impl.h for FreeBSD platform

Fix issue #174: FreeBSD was excluded from including the POSIX semaphore
implementation header. The previous conditional compilation had an empty
branch for LIBIPC_OS_FREEBSD, causing 'no member named sync in namespace
ipc::detail' errors.

FreeBSD supports POSIX semaphore APIs (sem_open, sem_wait, sem_post, etc.),
so it should use the same semaphore_impl.h as Linux and QNX.
This commit is contained in:
mutouyun 2026-01-29 03:20:25 +00:00
parent f7a181210c
commit 9ac5c24254

View File

@ -7,8 +7,7 @@
#include "libipc/platform/detail.h"
#if defined(LIBIPC_OS_WIN)
#include "libipc/platform/win/semaphore.h"
#elif defined(LIBIPC_OS_QNX) || defined(LIBIPC_OS_FREEBSD)
#elif defined(LIBIPC_OS_LINUX) || defined(LIBIPC_OS_QNX)
#elif defined(LIBIPC_OS_LINUX) || defined(LIBIPC_OS_QNX) || defined(LIBIPC_OS_FREEBSD)
#include "libipc/platform/posix/semaphore_impl.h"
#else/*IPC_OS*/
# error "Unsupported platform."