Index: include/random
===================================================================
--- include/random	(revision 192061)
+++ include/random	(working copy)
@@ -3475,7 +3475,9 @@

 class _LIBCPP_TYPE_VIS random_device
 {
+#if !defined(_WIN32)
     int __f_;
+#endif // defined(_WIN32)
 public:
     // types
     typedef unsigned result_type;
Index: src/random.cpp
===================================================================
--- src/random.cpp	(revision 192061)
+++ src/random.cpp	(working copy)
@@ -7,6 +7,9 @@
 //
 //===----------------------------------------------------------------------===//

+#// Must be defined before stdlib.h is included to enable rand_s().
+#define _CRT_RAND_S
+
 #include "random"
 #include "system_error"

@@ -19,6 +22,25 @@

 _LIBCPP_BEGIN_NAMESPACE_STD

+#if defined(_WIN32)
+random_device::random_device(const string& )
+{
+}
+
+random_device::~random_device()
+{
+}
+
+unsigned
+random_device::operator()()
+{
+    unsigned r;
+    errno_t err = rand_s(&r);
+    if (err)
+        __throw_system_error(err, "random_device rand_s failed.");
+    return r;
+}
+#else
 random_device::random_device(const string& __token)
     : __f_(open(__token.c_str(), O_RDONLY))
 {
@@ -38,6 +60,7 @@
     read(__f_, &r, sizeof(r));
     return r;
 }
+#endif // defined(_WIN32)

 double
 random_device::entropy() const _NOEXCEPT
