From bba377f675d71e4a259bdf374da1cf659eda1ddc Mon Sep 17 00:00:00 2001 From: Aaron Barany Date: Fri, 30 Nov 2018 20:36:00 -0800 Subject: [PATCH] Fix build on Linux (GCC 8.2) #include in syntaxhighlighter.cpp to have access to math functions. Use std:: namespace for math functions due to including the C++ header wrapper. Change-Id: I978cb4c54e29be38d4973f5a9cd1cede1bb49483 Reviewed-by: Orgad Shaneh --- src/plugins/texteditor/syntaxhighlighter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/texteditor/syntaxhighlighter.cpp b/src/plugins/texteditor/syntaxhighlighter.cpp index 76008dc9735..791b2e4a681 100644 --- a/src/plugins/texteditor/syntaxhighlighter.cpp +++ b/src/plugins/texteditor/syntaxhighlighter.cpp @@ -36,6 +36,8 @@ #include #include +#include + namespace TextEditor { class SyntaxHighlighterPrivate @@ -734,7 +736,7 @@ QList SyntaxHighlighter::generateColors(int n, const QColor &background) // Assign a color gradient. Generate a sufficient number of colors // by using ceil and looping from 0..step. const double oneThird = 1.0 / 3.0; - const int step = qRound(ceil(pow(double(n), oneThird))); + const int step = qRound(std::ceil(std::pow(double(n), oneThird))); result.reserve(step * step * step); const int factor = 255 / step; const int half = factor / 2;