From 145369149620591f7205faaa7f5ee44bdd5ce15e Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 31 Dec 2025 11:20:25 +0100 Subject: [PATCH] Fix feature check Use _POSIX_C_SOURCE to check for PTHREAD_MUTEX_ROBUST support. The latter is a enum, not a defined variable. closes https://github.com/official-stockfish/Stockfish/pull/6510 No functional change --- src/shm_linux.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shm_linux.h b/src/shm_linux.h index a8b5404b2..52abe8ec4 100644 --- a/src/shm_linux.h +++ b/src/shm_linux.h @@ -502,7 +502,7 @@ class SharedMemory: public detail::SharedMemoryBase { return false; bool success = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED) == 0; -#ifdef PTHREAD_MUTEX_ROBUST +#if _POSIX_C_SOURCE >= 200809L if (success) success = pthread_mutexattr_setrobust(&attr, PTHREAD_MUTEX_ROBUST) == 0; #endif @@ -524,7 +524,7 @@ class SharedMemory: public detail::SharedMemoryBase { if (rc == 0) return true; -#ifdef PTHREAD_MUTEX_ROBUST +#if _POSIX_C_SOURCE >= 200809L if (rc == EOWNERDEAD) { if (pthread_mutex_consistent(&header_ptr_->mutex) == 0)