From 8df2d4998b98d9de2894bbe800535b8280b71fea Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 15 Aug 2023 14:14:02 +1000 Subject: [PATCH] AP_Math: improve gating of use of AP_InternalError library - gate calls into library directly on the define - INTERNAL_ERROR becomes empty if library not compiled in --- libraries/AP_Math/AP_Math.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Math/AP_Math.cpp b/libraries/AP_Math/AP_Math.cpp index 0c363a312f..2e4d6ba9b5 100644 --- a/libraries/AP_Math/AP_Math.cpp +++ b/libraries/AP_Math/AP_Math.cpp @@ -270,7 +270,7 @@ T constrain_value_line(const T amt, const T low, const T high, uint32_t line) // errors through any function that uses constrain_value(). The normal // float semantics already handle -Inf and +Inf if (isnan(amt)) { -#if !defined(IOMCU_FW) +#if AP_INTERNALERROR_ENABLED AP::internalerror().error(AP_InternalError::error_t::constraining_nan, line); #endif return (low + high) / 2;