diff --git a/src/benchmark.cc b/src/benchmark.cc index 53c41429..54b5e676 100644 --- a/src/benchmark.cc +++ b/src/benchmark.cc @@ -543,6 +543,10 @@ std::unique_ptr CreateReporter( } // end namespace +bool IsZero(double n) { + return std::abs(n) < std::numeric_limits::epsilon(); +} + ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color) { int output_opts = ConsoleReporter::OO_Defaults; if ((FLAGS_benchmark_color == "auto" && IsColorTerminal()) || diff --git a/src/benchmark_api_internal.h b/src/benchmark_api_internal.h index 922ed8d7..c2208737 100644 --- a/src/benchmark_api_internal.h +++ b/src/benchmark_api_internal.h @@ -36,15 +36,10 @@ bool FindBenchmarksInternal(const std::string& re, std::vector* benchmarks, std::ostream* Err); +bool IsZero(double n); + ConsoleReporter::OutputOptions GetOutputOptions(bool force_no_color = false); -namespace { - -bool IsZero(double n) { - return std::abs(n) < std::numeric_limits::epsilon(); -} - -} // end namespace } // end namespace internal } // end namespace benchmark diff --git a/test/output_test_helper.cc b/test/output_test_helper.cc index 4e98553c..24746f6d 100644 --- a/test/output_test_helper.cc +++ b/test/output_test_helper.cc @@ -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 -------------------------------- //