Commit 4c929bc5 authored by Josh Watzman's avatar Josh Watzman Committed by Praveen Kumar Ramakrishnan

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
parent e2e4c525
......@@ -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<size_t>(length, mapLength_ - offset);
char* mapStart = static_cast<char*>(mapStart_) + offset;
PLOG_IF(WARNING, ::madvise(mapStart, length, advice)) << "madvise";
......
......@@ -98,7 +98,7 @@ inline void EventBaseLoopController::timedSchedule(std::function<void()> 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<long long int>(delay_ms, 0L);
eventBase_->tryRunAfterDelay(func, delay_ms);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment