Fix build failure with GCC 5
[folly.git] / folly / detail / MemoryIdler.h
index e4bebc3427f220151b1087893ed02ff997029bf9..324afac4f0e9837aeedfbf19bab0bc982c08259e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
 #include <folly/Hash.h>
 #include <folly/Traits.h>
 #include <folly/detail/Futex.h>
+#include <folly/portability/PThread.h>
 
 namespace folly {
 
@@ -92,7 +93,7 @@ struct MemoryIdler {
       // multiplying the duration by a floating point doesn't work, grr..
       auto extraFrac =
         timeoutVariationFrac / std::numeric_limits<uint64_t>::max() * h;
-      uint64_t tics = idleTimeout.count() * (1 + extraFrac);
+      auto tics = uint64_t(idleTimeout.count() * (1 + extraFrac));
       idleTimeout = typename Clock::duration(tics);
     }