Skip to content

Commit 081991e

Browse files
committed
Fix crash in OsRng when compiling with -O.
1 parent 9bdaf0b commit 081991e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libstd/rand/os.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,11 @@ mod imp {
136136
use rand::Rng;
137137
use result::{Ok, Err};
138138
use rt::stack;
139-
use self::libc::{c_ulong, DWORD, BYTE, LPCSTR, BOOL};
139+
use self::libc::{DWORD, BYTE, LPCSTR, BOOL};
140+
use self::libc::types::os::arch::extra::{LONG_PTR};
140141
use slice::MutableVector;
141142

142-
type HCRYPTPROV = c_ulong;
143+
type HCRYPTPROV = LONG_PTR;
143144

144145
/// A random number generator that retrieves randomness straight from
145146
/// the operating system. Platform sources:

0 commit comments

Comments
 (0)