SITL: fix pthread_setname_np to build on mac

This commit is contained in:
Guglie 2017-12-02 00:41:10 +01:00 committed by Peter Barker
parent 87658e6a07
commit 4eaa1f17df
1 changed files with 5 additions and 1 deletions

View File

@ -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