Skip to content

Commit d783993

Browse files
committed
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 <danielrpike9@gmail.com>
1 parent d109f0d commit d783993

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

AirLib/src/safety/SafetyEval.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ namespace airlib
211211
{
212212
//breaking distance at this velocity
213213
float velocity_mag = velocity.norm();
214-
float dest_pos_dist = std::max(velocity_mag * vehicle_params_.vel_to_breaking_dist,
214+
float dest_pos_dist = (std::max)(velocity_mag * vehicle_params_.vel_to_breaking_dist,
215215
vehicle_params_.min_breaking_dist);
216216

217217
//calculate dest_pos cur_pos we will be if we had to break suddenly

0 commit comments

Comments
 (0)