ReactOS 0.4.17-dev-1196-gb6224c3
rand_nt.c File Reference
#include <stdlib.h>
Include dependency graph for rand_nt.c:

Go to the source code of this file.

Functions

int __cdecl rand (void)
 
void __cdecl srand (unsigned seed)
 

Variables

static unsigned __int64 next = 0
 

Function Documentation

◆ rand()

int __cdecl rand ( void  )

Definition at line 12 of file rand_nt.c.

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}
#define RAND_MAX
Definition: stdlib.h:34
static unsigned __int64 next
Definition: rand_nt.c:6

◆ srand()

void __cdecl srand ( unsigned  seed)

Definition at line 26 of file rand_nt.c.

27{
28 next = seed;
29}

Variable Documentation

◆ next

unsigned __int64 next = 0
static

Definition at line 6 of file rand_nt.c.

Referenced by rand(), and srand().