From 4eaa1f17df2fec405a00d82a035fdfac4bf3f08b 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 31e0c7fd9e..e9054afd4f 100644 --- a/libraries/SITL/SIM_FlightAxis.cpp +++ b/libraries/SITL/SIM_FlightAxis.cpp @@ -103,7 +103,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