From d78399367c45e23872787c7bb59974c527dfa51b Mon Sep 17 00:00:00 2001 From: Bartok9 Date: Thu, 23 Jul 2026 05:25:26 -0400 Subject: [PATCH] fix(airlib): protect SafetyEval std::max from Windows macros Parenthesize std::max in getDestination breaking-distance clamp so MSVC windows.h min/max macros cannot break the template call. No algorithm change. File already #undef max; parenthesize is the portable form used elsewhere. Signed-off-by: Bartok9 --- AirLib/src/safety/SafetyEval.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AirLib/src/safety/SafetyEval.cpp b/AirLib/src/safety/SafetyEval.cpp index 5b051a4d6e..10dfc6baee 100644 --- a/AirLib/src/safety/SafetyEval.cpp +++ b/AirLib/src/safety/SafetyEval.cpp @@ -211,7 +211,7 @@ namespace airlib { //breaking distance at this velocity float velocity_mag = velocity.norm(); - float dest_pos_dist = std::max(velocity_mag * vehicle_params_.vel_to_breaking_dist, + float dest_pos_dist = (std::max)(velocity_mag * vehicle_params_.vel_to_breaking_dist, vehicle_params_.min_breaking_dist); //calculate dest_pos cur_pos we will be if we had to break suddenly