From ab31fcb8f4e4d0a36e1ba0f50d37d25b439c493b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Fri, 24 Aug 2018 21:42:50 -0300 Subject: [PATCH] AP_HAL_SITL: Makes scheduler compile under Mac OS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- libraries/AP_HAL_SITL/Scheduler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_SITL/Scheduler.cpp b/libraries/AP_HAL_SITL/Scheduler.cpp index 5980145a97..7bdcc2ea89 100644 --- a/libraries/AP_HAL_SITL/Scheduler.cpp +++ b/libraries/AP_HAL_SITL/Scheduler.cpp @@ -5,7 +5,11 @@ #include "UARTDriver.h" #include #include +#if defined (__clang__) +#include +#else #include +#endif #include 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; }