From b4ac15b3bbdfcf243cbdfcf88233f1da42ea8091 Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Fri, 2 Oct 2026 21:42:26 +0800 Subject: [PATCH] Keep Windows Setup Ahead of the Added libslic3r Includes Print.cpp and Thread.cpp open with a _WIN32 block that has to come first; without the precompiled header, Print.cpp otherwise reaches windows.h through OCCT with NONLS defined and boost/regex fails. OpenVDBUtils.cpp and SLA/SupportTreeBuilder.cpp had includes inside #ifndef NOMINMAX, which libslic3r defines on Windows, so those were skipped there. .clang-tidy also ignores the MSVC STL and UCRT internals, Boost.Multiprecision's fwd.hpp and CPython's Windows include directory. --- src/libslic3r/OpenVDBUtils.cpp | 3 ++- src/libslic3r/Print.cpp | 11 ++++++----- src/libslic3r/SLA/SupportTreeBuilder.cpp | 3 ++- src/libslic3r/Thread.cpp | 15 ++++++++------- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/libslic3r/OpenVDBUtils.cpp b/src/libslic3r/OpenVDBUtils.cpp index a7d28dfa4f..d4ac09781d 100644 --- a/src/libslic3r/OpenVDBUtils.cpp +++ b/src/libslic3r/OpenVDBUtils.cpp @@ -1,5 +1,7 @@ #ifndef NOMINMAX #define NOMINMAX +#endif + #include #include #include @@ -12,7 +14,6 @@ #include "libslic3r.h" #include #include -#endif #include "OpenVDBUtils.hpp" #ifdef _MSC_VER diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 1063f7ba95..bb91441c79 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -1,3 +1,9 @@ +#ifdef _WIN32 +// Keep this first. A header below reaches boost/regex, whose w32_regex_traits +// needs the Win32 types declared already. +#include +#endif + #include "PrintBase.hpp" #include #include @@ -47,11 +53,6 @@ #include #include #include "TriangleMesh.hpp" -#ifdef _WIN32 -// Keep this first. A header below reaches boost/regex, whose w32_regex_traits -// needs the Win32 types declared already. -#include -#endif #include "Config.hpp" #include "Exception.hpp" #include "Print.hpp" diff --git a/src/libslic3r/SLA/SupportTreeBuilder.cpp b/src/libslic3r/SLA/SupportTreeBuilder.cpp index 68a8a70eb6..635b5452d1 100644 --- a/src/libslic3r/SLA/SupportTreeBuilder.cpp +++ b/src/libslic3r/SLA/SupportTreeBuilder.cpp @@ -1,5 +1,7 @@ #ifndef NOMINMAX #define NOMINMAX +#endif + #include "libslic3r/SLA/SpatIndex.hpp" #include "libslic3r/ExPolygon.hpp" #include "libslic3r/SLA/Pad.hpp" @@ -14,7 +16,6 @@ #include #include "libslic3r/BoundingBox.hpp" #include "libslic3r/SLA/SupportTree.hpp" -#endif #include #include diff --git a/src/libslic3r/Thread.cpp b/src/libslic3r/Thread.cpp index e0d839153e..066656c9ed 100644 --- a/src/libslic3r/Thread.cpp +++ b/src/libslic3r/Thread.cpp @@ -1,10 +1,3 @@ -#include -#include -#include -#include -#include -#include -#include #ifdef _WIN32 #include #include @@ -13,6 +6,14 @@ #include #endif +#include +#include +#include +#include +#include +#include +#include + #include #include #include