[PATCH] libc++: add NaCl and PNaCl support for std::random_device

JF Bastien jfb at chromium.org
Sat Nov 29 12:00:25 PST 2014


>>! In D6442#9, @mclow.lists wrote:
> I'd really prefer a different identifier other than `__native_client__`.
> IMHO, that's too "generic".
> 
> Something that mentioned NaCl and/or PNaCl.
> `_LIBCPP_USING_NACL_RANDOM`, maybe?

Done, let me know if what I implemented was what you were suggesting.

================
Comment at: src/random.cpp:79
@@ +78,3 @@
+    else if (bytes_written != n)
+        __throw_runtime_error("random_device failed obtaining enough bytes");
+    return r;
----------------
majnemer wrote:
> This read a little funny to me, maybe:
> > random_device failed to obtain enough bytes
Changed.

http://reviews.llvm.org/D6442






More information about the cfe-commits mailing list