AP_HAL_SITL: Makes scheduler compile under Mac OS

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira 2018-08-24 21:42:50 -03:00 committed by Andrew Tridgell
parent bf274cd9db
commit ab31fcb8f4
1 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,11 @@
#include "UARTDriver.h"
#include <sys/time.h>
#include <fenv.h>
#if defined (__clang__)
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include <AP_Common/Semaphore.h>
using namespace HALSITL;
@ -263,7 +267,7 @@ bool Scheduler::thread_create(AP_HAL::MemberProc proc, const char *name, uint32_
if (!a->f) {
goto failed;
}
a->stack = memalign(4096, alloc_stack);
posix_memalign(&a->stack, 4096, alloc_stack);
if (!a->stack) {
goto failed;
}