Commit ec6f0357 by Joao Paulo Magalhaes

Trying again to fix error caused by -Wunused-function.

This thing with the pragma ignore was getting out of hand: now MinGW (and probably GCC) was erroring too. So I chose to move the definition of IsZero() out of the anonymous namespace into benchmark.cc.
parent 17354131
......@@ -543,6 +543,10 @@ std::unique_ptr<BenchmarkReporter> CreateReporter(
} // end namespace
bool IsZero(double n) {
return std::abs(n) < std::numeric_limits<double>::epsilon();
}
ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color) {
int output_opts = ConsoleReporter::OO_Defaults;
if ((FLAGS_benchmark_color == "auto" && IsColorTerminal()) ||
......
......@@ -36,15 +36,10 @@ bool FindBenchmarksInternal(const std::string& re,
std::vector<Benchmark::Instance>* benchmarks,
std::ostream* Err);
ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color = false);
namespace {
bool IsZero(double n);
bool IsZero(double n) {
return std::abs(n) < std::numeric_limits<double>::epsilon();
}
ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color = false);
} // end namespace
} // end namespace internal
} // end namespace benchmark
......
......@@ -7,16 +7,7 @@
#include "../src/check.h" // NOTE: check.h is for internal use only!
#include "../src/re.h" // NOTE: re.h is for internal use only
#include "output_test.h"
// clang fails with -Werror because IsZero() is not used in this library
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wunused-function"
#endif
#include "../src/benchmark_api_internal.h" // IsZero() is provided here
#ifdef __clang__
# pragma clang diagnostic pop
#endif
#include "../src/benchmark_api_internal.h"
// ========================================================================= //
// ------------------------------ Internals -------------------------------- //
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment