ReactOS
0.4.16-dev-747-gbc52d5f
rand_nt.c
Go to the documentation of this file.
1
#include <stdlib.h>
2
3
#if defined(__GNUC__)
4
static
unsigned
long
long
next
= 0;
5
#else
6
static
unsigned
__int64
next
= 0;
7
#endif
8
9
/*
10
* @implemented
11
*/
12
int
__cdecl
rand
(
void
)
13
{
14
#if defined(__GNUC__)
15
next
=
next
* 0x5deece66dLL + 11;
16
#else
17
next
=
next
* 0x5deece66di64 + 11;
18
#endif
19
return
(
int
)((
next
>> 16) &
RAND_MAX
);
20
}
21
22
23
/*
24
* @implemented
25
*/
26
void
__cdecl
srand
(
unsigned
seed)
27
{
28
next
= seed;
29
}
__cdecl
#define __cdecl
Definition:
accygwin.h:79
__int64
#define __int64
Definition:
basetyps.h:16
RAND_MAX
#define RAND_MAX
Definition:
stdlib.h:87
rand
int __cdecl rand(void)
Definition:
rand_nt.c:12
srand
void __cdecl srand(unsigned seed)
Definition:
rand_nt.c:26
next
static unsigned __int64 next
Definition:
rand_nt.c:6
sdk
lib
crt
stdlib
rand_nt.c
Generated on Sat Feb 15 2025 06:14:02 for ReactOS by
1.9.6