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
This commit is contained in:
Steinar H. Gunderson
2026-01-01 15:52:01 +01:00
committed by Joost VandeVondele
parent e0fb783c30
commit 1453691496
+2 -2
View File
@@ -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)