From c033971528bf5a909ab2b6757dd45bd6eda58e28 Mon Sep 17 00:00:00 2001 From: Harry Chen Date: Sun, 9 Aug 2026 22:28:11 -0400 Subject: [PATCH] fix windows compile error/warning --- src/sfm/core/HostMemory.h | 3 +++ src/sfm/tests/sfm_ba_cpu_test.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sfm/core/HostMemory.h b/src/sfm/core/HostMemory.h index 0a2ebc7e..979fcadd 100644 --- a/src/sfm/core/HostMemory.h +++ b/src/sfm/core/HostMemory.h @@ -5,6 +5,9 @@ #include #if defined(_WIN32) +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN // rpcndr.h's `#define small char` reaches far from here +#endif #include #else #include diff --git a/src/sfm/tests/sfm_ba_cpu_test.cpp b/src/sfm/tests/sfm_ba_cpu_test.cpp index 0b3bb715..771bc00b 100644 --- a/src/sfm/tests/sfm_ba_cpu_test.cpp +++ b/src/sfm/tests/sfm_ba_cpu_test.cpp @@ -303,7 +303,7 @@ Reference referenceSolve(const BAProblem& P, double lambda, double lossParam, std::vector V(9 * (size_t)P.num_points, 0.0), bp(3 * (size_t)P.num_points, 0.0); std::vector Wp((size_t)P.num_points * n * 3, 0.0); - bacpu::withLoss(loss, [&](auto L) { + bacpu::withLoss(loss, [&]([[maybe_unused]] auto L) { // only decltype(L) is read for (uint32_t o = 0; o < P.num_obs; o++) { const uint32_t img = P.obs_image[o], pt = P.obs_point[o]; const BAProblem::Group& gr = P.groups[P.image_group[img]];