[libcxx] r294698 - __threading_support: fix windows build

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 9 18:49:52 PST 2017


Author: compnerd
Date: Thu Feb  9 20:49:52 2017
New Revision: 294698

URL: http://llvm.org/viewvc/llvm-project?rev=294698&view=rev
Log:
__threading_support: fix windows build

The build was broken as there was no overload for long and
std::chrono::nanoseconds.  Add an explicit conversion to use the
operator+.

Modified:
    libcxx/trunk/include/__threading_support

Modified: libcxx/trunk/include/__threading_support
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__threading_support?rev=294698&r1=294697&r2=294698&view=diff
==============================================================================
--- libcxx/trunk/include/__threading_support (original)
+++ libcxx/trunk/include/__threading_support Thu Feb  9 20:49:52 2017
@@ -591,7 +591,8 @@ void __libcpp_thread_sleep_for(const chr
 {
   using namespace chrono;
   // round-up to the nearest milisecond
-  milliseconds __ms = duration_cast<milliseconds>(__ns + 999999);
+  milliseconds __ms =
+      duration_cast<milliseconds>(__ns + chrono::nanoseconds(999999));
   Sleep(__ms.count());
 }
 




More information about the cfe-commits mailing list