AP_Math: esp32 with esp_idf have MIN and MAX defined to something else.

Author: Charles Villard <charlesvillard10@gmail.com>
Author: Buzz <davidbuzz@gmail.com>
This commit is contained in:
Buzz 2021-10-27 18:06:42 +10:00 committed by Andrew Tridgell
parent d4e2828540
commit adaccdf0ba

View File

@ -215,12 +215,14 @@ ftype norm(const T first, const U second, const Params... parameters)
return sqrtF(sq(first, second, parameters...)); return sqrtF(sq(first, second, parameters...));
} }
#undef MIN
template<typename A, typename B> template<typename A, typename B>
static inline auto MIN(const A &one, const B &two) -> decltype(one < two ? one : two) static inline auto MIN(const A &one, const B &two) -> decltype(one < two ? one : two)
{ {
return one < two ? one : two; return one < two ? one : two;
} }
#undef MAX
template<typename A, typename B> template<typename A, typename B>
static inline auto MAX(const A &one, const B &two) -> decltype(one > two ? one : two) static inline auto MAX(const A &one, const B &two) -> decltype(one > two ? one : two)
{ {