From 7472b87b674446657c31da4407a7f79b802dadf7 Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Fri, 18 Sep 2026 09:56:44 -0500 Subject: [PATCH] build: fix the macro redefinition that fails clang Debug builds (#15759) libslic3r_version.h defines ORCA_CHECK_GCODE_PLACEHOLDERS from the CMake option, 0 by default, and GCode.hpp then forces it to 1 whenever NDEBUG is undefined. Clang reports the second definition under -Wmacro-redefined, which is on by default, so since -Werror (#15660) every clang Debug build fails at the libslic3r files that include GCode.hpp. Release and RelWithDebInfo define NDEBUG and never compile the override, which is why no CI configuration sees it. The override dates from #3861 and has warned in every Debug build since. Undefine the macro before overriding it. Debug builds get the same value the redefinition already produced, so nothing else changes. Follow-up to #15749, refs #15748. --- src/libslic3r/GCode.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 8cf4aa03fb..5208c4a5f3 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -710,6 +710,7 @@ private: // Always check gcode placeholders when building in debug mode. #if !defined(NDEBUG) +#undef ORCA_CHECK_GCODE_PLACEHOLDERS #define ORCA_CHECK_GCODE_PLACEHOLDERS 1 #endif