[cfe-dev] [libcxx] random_device for Windows needs more storage

Yaron Keren yaron.keren at gmail.com
Tue Oct 8 02:21:34 PDT 2013


Hi David,

You are correct, I was under the wrong impression that longs are 64 bit on
Win32.  So indeed all references above map (with differing typdefs)
HCRYPTPROV to 32 bits on Win32 and 64 bits on Win64.

In any case, I submitted a patch using rand_s() from MSVCRT.

Yaron



2013/10/8 David Chisnall <David.Chisnall at cl.cam.ac.uk>

> On 7 Oct 2013, at 21:20, Yaron Keren <yaron.keren at gmail.com> wrote:
>
> > Looking in the MingW header file basestd.h, ULONG_PTR is defined to
> either __int64 in WIN64 or long in WIN32, so it is always 64 bit.
>
> Did I miss something?  Long is 32-bits on win32 (and on win64, which
> breaks a lot of code that assumes that you can round trip pointers through
> long, because even though the standard has never guaranteed this it's been
> possible on pretty much every system that isn't an IBM mainframe for
> decades).  On Win32, long is the size of a pointer, on Win64, __int64 is
> the size of a pointer.
>
> David
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131008/e0013beb/attachment.html>


More information about the cfe-dev mailing list