diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2020-04-02 10:33:08 +0200 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2020-04-02 12:56:43 +0000 |
commit | 340421ac53a75261544bfc686f99174af9531c09 (patch) | |
tree | 8a196abfced603688cc536204886b0dd5527a0c5 | |
parent | ae3201d71028f54719a308a791aabf272513efe1 (diff) | |
download | qtwebengine-chromium-340421ac53a75261544bfc686f99174af9531c09.tar.gz |
Fix perfetto build with gcc 5.3
The libstdc++ header <cmath> undefines the signbit macro of the libc header
<math.h>. Perfetto's header "string_writer.h" uses the signbit macro.
In GCC 5.3, we have the include chain
<regex> -> <bits/stl_algo.h> -> <random> -> <cmath>,
meaning <regex> cannot be used together with the signbit macro. But this is
exactly what Perfetto's "systrace_trace_parser.cc" does: it transitively
includes <regex> and "string_writer.h"; it thus fails to build with GCC 5.3.
In GCC 5.4 and 6, the include chain is changed to
<regex> -> <bits/stl_algo.h> -> <bits/uniform_int_dist.h>,
and the build the succeeds.
Fix by using <cmath> and std::signbit in "string_writer.h".
Change-Id: Id67001f90c7d91cf97dc4c46654905bcb92fb066
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | chromium/third_party/perfetto/include/perfetto/ext/base/string_writer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chromium/third_party/perfetto/include/perfetto/ext/base/string_writer.h b/chromium/third_party/perfetto/include/perfetto/ext/base/string_writer.h index 681324f18eb..bd5d301bf4e 100644 --- a/chromium/third_party/perfetto/include/perfetto/ext/base/string_writer.h +++ b/chromium/third_party/perfetto/include/perfetto/ext/base/string_writer.h @@ -18,7 +18,7 @@ #define INCLUDE_PERFETTO_EXT_BASE_STRING_WRITER_H_ #include <inttypes.h> -#include <math.h> +#include <cmath> #include <stdlib.h> #include <string.h> #include <limits> @@ -69,7 +69,7 @@ class StringWriter { // digits of the integer is less than |padding|. template <char padchar, uint64_t padding> void AppendPaddedInt(int64_t sign_value) { - const bool negate = signbit(static_cast<double>(sign_value)); + const bool negate = std::signbit(static_cast<double>(sign_value)); uint64_t absolute_value = static_cast<uint64_t>(std::abs(sign_value)); AppendPaddedInt<padchar, padding>(absolute_value, negate); } |