From 6080c3b4ba3afb918977d4354121ddac01c446c9 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 7 Apr 2020 20:14:00 -0700 Subject: [PATCH] Math.hxx: move cmath include out of define The _GLIBCXX_USE_C99_MATH macro is defined in glibcxx by c++config.h, which gets included by every header. Which means a header needs to be present. (cherry picked from commit 79e9aff3382d8b7521318c44835a6dd6b284e2c1) --- src/util/Math.hxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/util/Math.hxx b/src/util/Math.hxx index 9784c0b64..ad5cffd82 100644 --- a/src/util/Math.hxx +++ b/src/util/Math.hxx @@ -30,11 +30,16 @@ #ifndef MATH_HXX #define MATH_HXX +#include + +/* + * C99 math can be optionally omitted with gcc's libstdc++. + * Use boost if unavailable. + */ #if (defined(__GLIBCPP__) || defined(__GLIBCXX__)) && !defined(_GLIBCXX_USE_C99_MATH) #include using boost::math::lround; #else -#include using std::lround; #endif