mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-09 22:08:56 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user