File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ pub use self::abs::abs;
28
28
29
29
mod rand_r;
30
30
#[ cfg( feature = "rand_r" ) ]
31
- pub use self :: rand_r:: rand_r;
31
+ pub use self :: rand_r:: { rand_r, RAND_MAX } ;
32
32
#[ cfg( feature = "rand" ) ]
33
33
mod rand;
34
34
#[ cfg( feature = "rand" ) ]
Original file line number Diff line number Diff line change 3
3
//! Licensed under the Blue Oak Model Licence 1.0.0
4
4
use core:: ffi:: { c_int, c_uint} ;
5
5
6
+ #[ cfg_attr( not( feature = "rand_r" ) , export_name = "tinyrlibc_RAND_MAX" ) ]
7
+ #[ cfg_attr( feature = "rand_r" , no_mangle) ]
8
+ pub static RAND_MAX : c_int = 0x7FFF_FFFC as _ ;
9
+
6
10
/// Rust implementation of C library function `rand_r`
7
11
///
8
12
/// Passing NULL (core::ptr::null()) gives undefined behaviour.
@@ -29,7 +33,7 @@ pub unsafe extern "C" fn rand_r(seedp: *mut c_uint) -> c_int {
29
33
30
34
* seedp = next;
31
35
32
- result
36
+ result - 1
33
37
}
34
38
35
39
#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments