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 Andrew Tridgell
parent 206c4b95c7
commit 0ecce2ed22

View File

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