From c2116835da63bbb781d08a4fb018f8810a833e2e Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 25 Mar 2025 09:42:57 +0100 Subject: [PATCH] compat/platform_{pipe,semaphore}: IWYU --- src/audio/capture/jack.c | 1 + src/compat/platform_pipe.cpp | 17 ++++++++++------- src/compat/platform_semaphore.c | 14 +++++--------- src/compat/platform_semaphore.h | 4 ---- src/video_capture/testcard2.c | 1 + 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/audio/capture/jack.c b/src/audio/capture/jack.c index 082c248cc..48b04956c 100644 --- a/src/audio/capture/jack.c +++ b/src/audio/capture/jack.c @@ -44,6 +44,7 @@ #include "audio/types.h" #include "audio/utils.h" #include "compat/platform_semaphore.h" +#include "config.h" // for PACKAGE_STRING #include "debug.h" #include "host.h" #include "jack_common.h" diff --git a/src/compat/platform_pipe.cpp b/src/compat/platform_pipe.cpp index ba81637e0..d4f058d3d 100644 --- a/src/compat/platform_pipe.cpp +++ b/src/compat/platform_pipe.cpp @@ -35,17 +35,20 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif // HAVE_CONFIG_H -#include "config_unix.h" -#include "config_win32.h" - #include "compat/platform_pipe.h" -#include "rtp/net_udp.h" // socket_error +#include // for perror, NULL, fprintf, stderr +#include // for memset +#include // for timeval #include +#ifndef _WIN32 +#include // for pipe +#endif + +#include "rtp/net_udp.h" // socket_error +#include "compat/net.h" // htons etc. + using std::thread; #ifdef _WIN32 diff --git a/src/compat/platform_semaphore.c b/src/compat/platform_semaphore.c index d223bd37b..0e196021c 100644 --- a/src/compat/platform_semaphore.c +++ b/src/compat/platform_semaphore.c @@ -46,13 +46,11 @@ * */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#include "config_unix.h" -#include "config_win32.h" -#endif // HAVE_CONFIG_H +#include "compat/platform_semaphore.h" -#include "debug.h" +#include // for EINTR, errno +#include // for perror +#include // for abort #ifdef __APPLE__ #include @@ -62,12 +60,10 @@ #include #endif /* __APPLE__ */ -#include "compat/platform_semaphore.h" - void platform_sem_init(void *semStructure, int pshared, int initialValue) { #ifdef __APPLE__ - UNUSED(pshared); + (void) pshared; semaphore_create(mach_task_self(), (semaphore_t *) semStructure, SYNC_POLICY_FIFO, initialValue); #else diff --git a/src/compat/platform_semaphore.h b/src/compat/platform_semaphore.h index 2c1227137..37ca3e774 100644 --- a/src/compat/platform_semaphore.h +++ b/src/compat/platform_semaphore.h @@ -46,10 +46,6 @@ * */ -#include "config.h" -#include "config_unix.h" -#include "config_win32.h" - #ifndef _PLATFORM_SEMAPHORE_H #define _PLATFORM_SEMAPHORE_H diff --git a/src/video_capture/testcard2.c b/src/video_capture/testcard2.c index 41f308b2e..ef519514b 100644 --- a/src/video_capture/testcard2.c +++ b/src/video_capture/testcard2.c @@ -62,6 +62,7 @@ #include "audio/types.h" // for audio_frame #include "compat/platform_semaphore.h" // for platform_sem_post, platform_s... +#include "compat/usleep.h" // for usleep #include "debug.h" // for log_msg, LOG_LEVEL_ERROR, LOG... #include "host.h" // for exit_uv, audio_capture_channels #include "lib_common.h" // for REGISTER_MODULE, library_class