From 6fea458a54962fb9971e68c829eeb2cde05c923b Mon Sep 17 00:00:00 2001 From: Mark Meredith Date: Wed, 15 Jul 2020 14:46:30 -0400 Subject: [PATCH] Set cpp_std=vc++latest on Windows --- conanfile.py | 5 ++++- src/csg/levelset_3d.cpp | 5 +++-- src/csg/tests/meson.build | 1 - 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/conanfile.py b/conanfile.py index 1e41448..d0924b1 100644 --- a/conanfile.py +++ b/conanfile.py @@ -1,3 +1,5 @@ +import sys + from conans import ConanFile, Meson, tools @@ -22,7 +24,8 @@ class CsgEbConan(ConanFile): def build(self): meson = Meson(self) - meson.configure(build_folder="build") + args = ["-Dcpp_std=vc++latest"] if sys.platform in ("win32", "cygwin") else [] + meson.configure(build_folder="build", args=args) meson.build() meson.meson_test(args=["--verbose", "--print-errorlog"]) diff --git a/src/csg/levelset_3d.cpp b/src/csg/levelset_3d.cpp index 50bad90..1f3756c 100644 --- a/src/csg/levelset_3d.cpp +++ b/src/csg/levelset_3d.cpp @@ -2,10 +2,11 @@ #include "csg_types.hpp" #include -#include #include #include +const double DEGREES_PER_RADIAN = 45 / std::atan(1); + namespace { template struct overloaded : Ts... { using Ts::operator()...; }; @@ -145,7 +146,7 @@ double signed_distance_3d(const LinearExtrude &lin_ext, double xx, double yy, double signed_distance_3d(const RotateExtrude &rot_ext, double xx, double yy, double zz) { - double tt = atan(yy / xx) * 180 / M_PI; + double tt = atan(yy / xx) * DEGREES_PER_RADIAN; if ((xx < 0 && yy >= 0) || (xx < 0 && yy < 0)) tt += 180; // Quadrants II & III else if (xx >= 0 && yy < 0) diff --git a/src/csg/tests/meson.build b/src/csg/tests/meson.build index b2897a6..b08f621 100644 --- a/src/csg/tests/meson.build +++ b/src/csg/tests/meson.build @@ -14,7 +14,6 @@ test_csg = executable('unit_tests_csg', include_directories: [parser_inc], dependencies: [catch2, cgal], link_with: lib_csg_parser, - override_options: 'cpp_std=c++2a', ) test('unit_test_csg', test_csg) -- GitLab