From 5ff6633588be1f7b0d0857941a0f9fe4ed5366b3 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Thu, 10 Jul 2014 13:19:28 -0700 Subject: [PATCH] Fix mac compile --- util/rate_limiter_test.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/util/rate_limiter_test.cc b/util/rate_limiter_test.cc index 348a8f628..66735f9e8 100644 --- a/util/rate_limiter_test.cc +++ b/util/rate_limiter_test.cc @@ -7,6 +7,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. +#define __STDC_FORMAT_MACROS +#include #include #include "util/testharness.h" #include "util/rate_limiter.h" @@ -63,10 +65,10 @@ TEST(RateLimiterTest, Rate) { auto elapsed = env->NowMicros() - start; double rate = arg.limiter->GetTotalBytesThrough() * 1000000.0 / elapsed; - fprintf(stderr, "request size [1 - %ld], limit %ld KB/sec, " - "actual rate: %lf KB/sec, elapsed %.2lf seconds\n", - arg.request_size - 1, target / 1024, rate / 1024, - elapsed / 1000000.0); + fprintf(stderr, "request size [1 - %" PRIi64 "], limit %" PRIi64 + " KB/sec, actual rate: %lf KB/sec, elapsed %.2lf seconds\n", + arg.request_size - 1, target / 1024, rate / 1024, + elapsed / 1000000.0); ASSERT_GE(rate / target, 0.95); ASSERT_LE(rate / target, 1.05);