Fix warnings about _USE_MATH_DEFINES on Windows

This commit is contained in:
Alessandro Ranellucci 2018-11-23 23:30:43 +01:00
parent 908b8db5dc
commit 1e17979e05
3 changed files with 6 additions and 4 deletions

View File

@ -78,9 +78,7 @@ if ($^O eq 'darwin') {
}
}
if ($mswin) {
# In case windows.h is included, we don't want the min / max macros to be active.
# If <math.h> is included, we want the #defines to be active (M_PI etc.)
push @cflags, qw(-DNOMINMAX -D_USE_MATH_DEFINES);
push @cflags, qw(-DNOMINMAX);
}
my @INC = qw(-Isrc/libslic3r);

View File

@ -1,7 +1,6 @@
#include "../ClipperUtils.hpp"
#include "../PolylineCollection.hpp"
#include "../Surface.hpp"
#define _USE_MATH_DEFINES
#include <cmath>
#include <algorithm>
#include <iostream>

View File

@ -4,7 +4,12 @@
// this needs to be included early for MSVC (listing it in Build.PL is not enough)
#include <ostream>
#include <iostream>
// Otherwise #defines like M_PI are undeclared under Visual Studio
#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#include <queue>
#include <sstream>