From 41c46b0e82e5530435b09f42f05254c575bc8703 Mon Sep 17 00:00:00 2001 From: Nicholas Sharp Date: Sun, 3 May 2026 16:24:37 -0700 Subject: [PATCH] move private header-only deps to anon namespaces to hide symbols --- src/surface/mesh_ray_tracer.cpp | 16 ++++++++++++++++ src/utilities/knn.cpp | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/surface/mesh_ray_tracer.cpp b/src/surface/mesh_ray_tracer.cpp index 6e6a9be0..72ec6a64 100644 --- a/src/surface/mesh_ray_tracer.cpp +++ b/src/surface/mesh_ray_tracer.cpp @@ -1,6 +1,22 @@ #include "geometrycentral/surface/mesh_ray_tracer.h" +// we need to include these for nanort before it tries to include them inside the anonymous namespace. +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +namespace { +// put it in an anonymous namespace to avoid exposing symbols #include "nanort.h" +} // namespace namespace geometrycentral { namespace surface { diff --git a/src/utilities/knn.cpp b/src/utilities/knn.cpp index 2bcf57a3..d9ed12a6 100644 --- a/src/utilities/knn.cpp +++ b/src/utilities/knn.cpp @@ -1,6 +1,26 @@ #include "geometrycentral/utilities/knn.h" +// we need to include these for nanoflann before it tries to include them inside the anonymous namespace. +#include +#include +#include +#include +#include // for abs() +#include +#include // for abs() +#include // std::reference_wrapper +#include +#include +#include // std::numeric_limits +#include +#include +#include +#include +#include +namespace { +// put it in an anonymous namespace to avoid exposing symbols #include "nanoflann.hpp" +} using std::vector;