From 983e13c3b79517c502c1298b66348309108f1534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20B=C3=A4hr?= Date: Mon, 22 Aug 2022 21:39:09 +0200 Subject: [PATCH] Fix build on MacOS-X 10.14: missing cmath header This undoes a small part of commit 9ec0bcdcf2e975ee2086a9f8c2b5b8910e80949c, which seems a bit too agressive. Without the cmath header the build fails using Apple clang version 11.0.0 (clang-1100.0.33.17) on Mojave with the following error: .../FreeCAD-git/src/Base/UnitsSchemaInternal.cpp:39:24: error: call to 'abs' is ambiguous double UnitValue = std::abs(quant.getValue()); ^~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:132:6: note: candidate function int abs(int) __pure2; ^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdlib.h:111:44: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^ /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/stdlib.h:113:44: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} ^ 1 error generated. --- src/Base/UnitsSchemaInternal.cpp | 1 + src/Base/UnitsSchemaMKS.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Base/UnitsSchemaInternal.cpp b/src/Base/UnitsSchemaInternal.cpp index fcdb4b3f49..f00be684e3 100644 --- a/src/Base/UnitsSchemaInternal.cpp +++ b/src/Base/UnitsSchemaInternal.cpp @@ -29,6 +29,7 @@ #include #include "UnitsSchemaInternal.h" +#include using namespace Base; diff --git a/src/Base/UnitsSchemaMKS.cpp b/src/Base/UnitsSchemaMKS.cpp index 669d4dea9d..2bb0f9ab40 100644 --- a/src/Base/UnitsSchemaMKS.cpp +++ b/src/Base/UnitsSchemaMKS.cpp @@ -29,6 +29,7 @@ #include #include "UnitsSchemaMKS.h" +#include using namespace Base;