Fix libc++ use
authorPraveen Kumar <cpp.fool@gmail.com>
Wed, 10 Jun 2015 22:21:07 +0000 (15:21 -0700)
committerSara Golemon <sgolemon@fb.com>
Wed, 10 Jun 2015 22:30:29 +0000 (15:30 -0700)
Summary: Use of std::max from libc++ resulted in error.
std::max found type of its arguments diffrent
whereas it expected them to be same.
This diff fix the error.
Closes #223

Reviewed By: @yfeldblum

Differential Revision: D2144639

Pulled By: @sgolemon

folly/io/async/AsyncServerSocket.cpp

index 8520f464f47d4b9c847eb8a50239586da9ef705a..34fa5c6fc8796c8e2c6f61a4514bf00cfb98acdd 100644 (file)
@@ -726,8 +726,8 @@ void AsyncServerSocket::handlerReady(
 
     std::chrono::time_point<std::chrono::steady_clock> nowMs =
       std::chrono::steady_clock::now();
 
     std::chrono::time_point<std::chrono::steady_clock> nowMs =
       std::chrono::steady_clock::now();
-    int64_t timeSinceLastAccept = std::max(
-      int64_t(0),
+    auto timeSinceLastAccept = std::max<int64_t>(
+      0,
       nowMs.time_since_epoch().count() -
       lastAccepTimestamp_.time_since_epoch().count());
     lastAccepTimestamp_ = nowMs;
       nowMs.time_since_epoch().count() -
       lastAccepTimestamp_.time_since_epoch().count());
     lastAccepTimestamp_ = nowMs;