From 0ecce2ed226f8ab63b47a265544a1b3de2c918c9 Mon Sep 17 00:00:00 2001 From: Guglie Date: Sat, 2 Dec 2017 00:41:10 +0100 Subject: [PATCH] SITL: fix pthread_setname_np to build on mac --- libraries/SITL/SIM_FlightAxis.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/SITL/SIM_FlightAxis.cpp b/libraries/SITL/SIM_FlightAxis.cpp index b33b2dfdef..b60abdc8ca 100644 --- a/libraries/SITL/SIM_FlightAxis.cpp +++ b/libraries/SITL/SIM_FlightAxis.cpp @@ -125,7 +125,11 @@ void *FlightAxis::update_thread(void *arg) { FlightAxis *flightaxis = (FlightAxis *)arg; -#ifndef __CYGWIN__ +#ifdef __CYGWIN__ + //Cygwin doesn't support pthread_setname_np +#elif defined(__APPLE__) && defined(__MACH__) + pthread_setname_np("ardupilot-flightaxis"); +#else pthread_setname_np(pthread_self(), "ardupilot-flightaxis"); #endif