From 5a1e8e0f65de3e6b0ee9cd67f2439a89a3ccfaa7 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 24 May 2017 13:19:57 +0200 Subject: [PATCH] Fix some compilation warnings --- xs/Build.PL | 6 ++++++ xs/MANIFEST | 16 ++++++++++++++++ xs/src/libslic3r/TriangleMesh.cpp | 4 ++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/xs/Build.PL b/xs/Build.PL index 8b622b5c3..2633b8870 100644 --- a/xs/Build.PL +++ b/xs/Build.PL @@ -11,6 +11,9 @@ use Module::Build::WithXSpp; my $cpp_guess = ExtUtils::CppGuess->new; my $mswin = $^O eq 'MSWin32'; +# prevent an annoying concatenation warning by Devel::CheckLib +$ENV{LD_RUN_PATH} //= ""; + # _GLIBCXX_USE_C99 : to get the long long type for g++ # HAS_BOOL : stops Perl/lib/CORE/handy.h from doing "# define bool char" for MSVC # NOGDI : prevents inclusion of wingdi.h which defines functions Polygon() and Polyline() in global namespace @@ -199,6 +202,9 @@ if ($cpp_guess->is_gcc) { # https://svn.boost.org/trac/boost/ticket/8695 push @cflags, qw(-fno-inline-small-functions); } + + # our templated XS bindings cause undefined-var-template warnings + push @cflags, qw(-Wno-undefined-var-template); } my $build = Module::Build::WithXSpp->new( diff --git a/xs/MANIFEST b/xs/MANIFEST index 5b2925f2c..b9e98e0a6 100644 --- a/xs/MANIFEST +++ b/xs/MANIFEST @@ -1,5 +1,6 @@ Build.PL lib/Slic3r/XS.pm +libslic3r.doxygen MANIFEST This list of files src/admesh/connect.c src/admesh/normals.c @@ -8,6 +9,21 @@ src/admesh/stl.h src/admesh/stl_io.c src/admesh/stlinit.c src/admesh/util.c +src/boost/nowide/args.hpp +src/boost/nowide/cenv.hpp +src/boost/nowide/config.hpp +src/boost/nowide/convert.hpp +src/boost/nowide/cstdio.hpp +src/boost/nowide/cstdlib.hpp +src/boost/nowide/filebuf.hpp +src/boost/nowide/fstream.hpp +src/boost/nowide/integration/filesystem.hpp +src/boost/nowide/iostream.cpp +src/boost/nowide/iostream.hpp +src/boost/nowide/stackstring.hpp +src/boost/nowide/system.hpp +src/boost/nowide/utf8_codecvt.hpp +src/boost/nowide/windows.hpp src/clipper.cpp src/clipper.hpp src/expat/ascii.h diff --git a/xs/src/libslic3r/TriangleMesh.cpp b/xs/src/libslic3r/TriangleMesh.cpp index 9e3c8bf1a..5a3a5a1ef 100644 --- a/xs/src/libslic3r/TriangleMesh.cpp +++ b/xs/src/libslic3r/TriangleMesh.cpp @@ -684,7 +684,7 @@ TriangleMesh::make_sphere(double rho, double fa) { // Fixed scaling const double z = -rho + increment*rho*2.0; // radius of the circle for this step. - const double r = sqrt(abs(rho*rho - z*z)); + const double r = sqrt(std::abs(rho*rho - z*z)); Pointf3 b(0, r, z); b.rotate(ring[i], Pointf3(0,0,z)); vertices.push_back(b); @@ -699,7 +699,7 @@ TriangleMesh::make_sphere(double rho, double fa) { // General case: insert and form facets for each step, joining it to the ring below it. for (size_t s = 2; s < steps - 1; s++) { const double z = -rho + increment*(double)s*2.0*rho; - const double r = sqrt(abs(rho*rho - z*z)); + const double r = sqrt(std::abs(rho*rho - z*z)); for (size_t i = 0; i < ring.size(); i++) { Pointf3 b(0, r, z);