From 03f0e2196e5d8d4c4daf9c312f7dbd0aba839b16 Mon Sep 17 00:00:00 2001 From: gabime Date: Thu, 6 Jun 2019 18:13:30 +0300 Subject: [PATCH] Fix async bench under msvc --- bench/async_bench.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bench/async_bench.cpp b/bench/async_bench.cpp index df5cbdc5..0644f279 100644 --- a/bench/async_bench.cpp +++ b/bench/async_bench.cpp @@ -26,6 +26,11 @@ using namespace utils; void bench_mt(int howmany, std::shared_ptr log, int thread_count); +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4996) //disable fopen warning under msvc +#endif // _MSC_VER + int count_lines(const char *filename) { int counter = 0; @@ -40,6 +45,11 @@ int count_lines(const char *filename) return counter; } +#ifdef _MSC_VER +#pragma warning(pop) +#endif + + int main(int argc, char *argv[]) { @@ -148,3 +158,6 @@ void bench_mt(int howmany, std::shared_ptr logger, int thread_co auto delta_d = duration_cast>(delta).count(); spdlog::info("Elapsed: {} secs\t {:n}/sec", delta_d, int(howmany / delta_d)); } + +async_bench.cpp + Displaying async_bench.cpp. \ No newline at end of file