From 57ab54c124341afdfac325c7ea9a1935e4bfcf55 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 2 Mar 2020 17:09:56 +0300 Subject: [PATCH] Fixed build on Mac OS X --- dbms/src/Common/ThreadFuzzer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dbms/src/Common/ThreadFuzzer.cpp b/dbms/src/Common/ThreadFuzzer.cpp index a0bf6cb95c6..938e053b778 100644 --- a/dbms/src/Common/ThreadFuzzer.cpp +++ b/dbms/src/Common/ThreadFuzzer.cpp @@ -119,7 +119,10 @@ void ThreadFuzzer::setup() static constexpr UInt32 TIMER_PRECISION = 1000000; - struct timeval interval{.tv_sec = long(cpu_time_period_us / TIMER_PRECISION), .tv_usec = long(cpu_time_period_us % TIMER_PRECISION)}; + struct timeval interval; + interval.tv_sec = cpu_time_period_us / TIMER_PRECISION; + interval.tv_usec = cpu_time_period_us % TIMER_PRECISION; + struct itimerval timer = {.it_interval = interval, .it_value = interval}; if (0 != setitimer(ITIMER_PROF, &timer, nullptr))