From 81711eb28e69493f455a2f2347e94cdfbd5db300 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 28 Sep 2019 07:54:48 +1000 Subject: [PATCH] AP_HAL: fixed build on g++ 7.3 for stm32 the system maths headers don't like our maths defines, but are happy if we include math.h first --- libraries/AP_HAL/AP_HAL_Macros.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/AP_HAL/AP_HAL_Macros.h b/libraries/AP_HAL/AP_HAL_Macros.h index f0c6f1bca7..99bd7c042c 100644 --- a/libraries/AP_HAL/AP_HAL_Macros.h +++ b/libraries/AP_HAL/AP_HAL_Macros.h @@ -13,6 +13,9 @@ #define ALLOW_DOUBLE_MATH_FUNCTIONS #endif +// we need to include math.h here for newer compilers (eg. g++ 7.3.1 for stm32) +#include + #if !defined(ALLOW_DOUBLE_MATH_FUNCTIONS) /* give warnings if we use double precision maths functions without specifying ALLOW_DOUBLE_TRIG_FUNCTIONS. Code should use the