From f0170e3af1166c934f61685ac1da34699f6e963c Mon Sep 17 00:00:00 2001 From: Bartok9 Date: Wed, 29 Jul 2026 05:23:26 -0400 Subject: [PATCH] fix(examples): protect DepthNavOptAStar ray costs from Windows min macros Parenthesize std::min in setRayCost so windows.h min macros cannot break goal_on_ray / d1 calculations. --- Examples/DepthNav/DepthNavOptAStar.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/DepthNav/DepthNavOptAStar.hpp b/Examples/DepthNav/DepthNavOptAStar.hpp index fbcf4c3402..c1dcdb4e05 100644 --- a/Examples/DepthNav/DepthNavOptAStar.hpp +++ b/Examples/DepthNav/DepthNavOptAStar.hpp @@ -238,8 +238,8 @@ namespace airlib void setRayCost(SampleRay& sample_ray, const Vector3r& goal_body, real_T goal_dist) { - real_T goal_on_ray = std::min(goal_body.dot(sample_ray.ray), 0.0f); - real_T d1 = std::min(sample_ray.obs_dist, goal_on_ray); + real_T goal_on_ray = (std::min)(goal_body.dot(sample_ray.ray), 0.0f); + real_T d1 = (std::min)(sample_ray.obs_dist, goal_on_ray); sample_ray.d1_v = sample_ray.ray * d1; sample_ray.d2_v = goal_body - sample_ray.d1_v;