diff --git a/xs/src/libslic3r/GCode/ToolOrdering.hpp b/xs/src/libslic3r/GCode/ToolOrdering.hpp index 1a9f1baff..fe2c394c5 100644 --- a/xs/src/libslic3r/GCode/ToolOrdering.hpp +++ b/xs/src/libslic3r/GCode/ToolOrdering.hpp @@ -71,7 +71,7 @@ public: const LayerTools& back() const { return m_layer_tools.back(); } bool empty() const { return m_layer_tools.empty(); } const std::vector& layer_tools() const { return m_layer_tools; } - bool has_wipe_tower() const { return ! m_layer_tools.empty() && m_first_printing_extruder != (size_t)-1 && m_layer_tools.front().wipe_tower_partitions > 0; } + bool has_wipe_tower() const { return ! m_layer_tools.empty() && m_first_printing_extruder != (unsigned int)-1 && m_layer_tools.front().wipe_tower_partitions > 0; } private: void initialize_layers(std::vector &zs); @@ -82,9 +82,9 @@ private: std::vector m_layer_tools; // First printing extruder, including the multi-material priming sequence. - unsigned int m_first_printing_extruder; + unsigned int m_first_printing_extruder = (unsigned int)-1; // Final printing extruder. - unsigned int m_last_printing_extruder; + unsigned int m_last_printing_extruder = (unsigned int)-1; // All extruders, which extrude some material over m_layer_tools. std::vector m_all_printing_extruders; }; diff --git a/xs/src/libslic3r/libslic3r.h b/xs/src/libslic3r/libslic3r.h index 4a68b030d..e70113710 100644 --- a/xs/src/libslic3r/libslic3r.h +++ b/xs/src/libslic3r/libslic3r.h @@ -92,6 +92,11 @@ inline std::string debug_out_path(const char *name, ...) #define UNUSED(x) (void)(x) #endif /* UNUSED */ +// Detect whether the compiler supports C++11 noexcept exception specifications. +#if defined(_MSC_VER) && _MSC_VER < 1900 + #define noexcept throw() +#endif + // Write slices as SVG images into out directory during the 2D processing of the slices. // #define SLIC3R_DEBUG_SLICE_PROCESSING diff --git a/xs/xsp/GCode.xsp b/xs/xsp/GCode.xsp index ea54fd3a7..2b6809a39 100644 --- a/xs/xsp/GCode.xsp +++ b/xs/xsp/GCode.xsp @@ -41,5 +41,5 @@ %}; Ref config() - %code{% RETVAL = const_cast(dynamic_cast(&THIS->config())); %}; + %code{% RETVAL = const_cast(static_cast(&THIS->config())); %}; };