From 4c929bc52df23c4c964b29a731b768ecb1619cf8 Mon Sep 17 00:00:00 2001 From: Josh Watzman Date: Mon, 4 May 2015 14:54:40 -0700 Subject: [PATCH] Explicitly template instantiate `std::min/max` in a couple places Summary: This is for OS X; there is apparently some difference between its types and Linux's typical types, causing incomopatibilities between a `long int` and a `long long int`. These two explicit template instantiations fix the issue. Test Plan: g++-4.9 on OS X compiles these files now. Reviewed By: lucian@fb.com Subscribers: folly-diffs@, yfeldblum, chalfant FB internal diff: D2040509 Signature: t1:2040509:1430516624:9db8146b7824c0d09bac418a10a5f54451cdd5db --- folly/MemoryMapping.cpp | 2 +- folly/experimental/fibers/EventBaseLoopController-inl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/MemoryMapping.cpp b/folly/MemoryMapping.cpp index 3d8e3a55..e09c391e 100644 --- a/folly/MemoryMapping.cpp +++ b/folly/MemoryMapping.cpp @@ -311,7 +311,7 @@ void MemoryMapping::advise(int advice, size_t offset, size_t length) const { } length = (length + options_.pageSize - 1) & ~(options_.pageSize - 1); - length = std::min(length, mapLength_ - offset); + length = std::min(length, mapLength_ - offset); char* mapStart = static_cast(mapStart_) + offset; PLOG_IF(WARNING, ::madvise(mapStart, length, advice)) << "madvise"; diff --git a/folly/experimental/fibers/EventBaseLoopController-inl.h b/folly/experimental/fibers/EventBaseLoopController-inl.h index a38d3637..363cef2f 100644 --- a/folly/experimental/fibers/EventBaseLoopController-inl.h +++ b/folly/experimental/fibers/EventBaseLoopController-inl.h @@ -98,7 +98,7 @@ inline void EventBaseLoopController::timedSchedule(std::function func, auto delay_ms = std::chrono::duration_cast< std::chrono::milliseconds>(time - Clock::now()).count() + 1; // If clock is not monotonic - delay_ms = std::max(delay_ms, 0L); + delay_ms = std::max(delay_ms, 0L); eventBase_->tryRunAfterDelay(func, delay_ms); } -- 2.34.1