fix(windows-shim): widen pthread.h MSVC gate to include clang-cl

The MSVC-only branch of the pthread shim was gated on
`_MSC_VER && !defined(__clang__)`, which excluded clang-cl. Under
clang-cl on the MSVC environment that meant the `#else` branch ran
and tried to forward to a real `<pthread.h>` via `#include_next`,
but clang-cl has no winpthreads on its search path so the include
failed with `'pthread.h' file not found`.

Widen the gate to `defined(_MSC_VER)` so clang-cl uses the same
from-scratch shim as MSVC. Only true MinGW (where `_MSC_VER` is
not defined) keeps the `#include_next` forward to winpthreads.

Same change applied to the inner gate on
`px4_pthread_cond_notify_callback_t` for consistency.

Signed-off-by: Nuno Marques <n.marques21@hotmail.com>
This commit is contained in:
Nuno Marques
2026-05-07 17:51:23 -07:00
parent 03454c81f7
commit 62b6ed9689
@@ -42,7 +42,7 @@
*/
#pragma once
#if defined(_MSC_VER) && !defined(__clang__)
#if defined(_MSC_VER)
#include <windows.h>
#include <time.h>
#include <stdint.h>
@@ -178,7 +178,7 @@ int pthread_cond_signal(pthread_cond_t *cond);
int pthread_cond_broadcast(pthread_cond_t *cond);
/** @} */
#if defined(_MSC_VER) && !defined(__clang__)
#if defined(_MSC_VER)
typedef void (*px4_pthread_cond_notify_callback_t)(pthread_cond_t *cond, int broadcast);
int px4_pthread_cond_set_notify_callback(px4_pthread_cond_notify_callback_t callback);
#endif