From a2a70bbb15ede914c554834d8553a5ee5e09cc0a Mon Sep 17 00:00:00 2001 From: arancormonk <180709949+arancormonk@users.noreply.github.com> Date: Sun, 7 Sep 2025 09:13:03 -0500 Subject: [PATCH] Fix Cygwin build --- src/rtl_sdr_fm.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rtl_sdr_fm.cpp b/src/rtl_sdr_fm.cpp index b953ef9..50e3c73 100644 --- a/src/rtl_sdr_fm.cpp +++ b/src/rtl_sdr_fm.cpp @@ -1432,6 +1432,7 @@ static void maybe_set_thread_realtime_and_affinity(const char *role) if (cpu_str && cpu_str[0] != '\0') { int cpu = atoi(cpu_str); if (cpu >= 0) { +#if defined(__linux__) && !defined(__CYGWIN__) cpu_set_t cpuset; CPU_ZERO(&cpuset); CPU_SET((unsigned)cpu, &cpuset); @@ -1440,6 +1441,10 @@ static void maybe_set_thread_realtime_and_affinity(const char *role) } else { fprintf(stderr, "%s thread pinned to CPU %d.\n", role, cpu); } +#else + (void)cpu; + fprintf(stderr, "NOTICE: CPU affinity not supported on this platform.\n"); +#endif } } }