ReactOS
0.4.16-dev-2473-gb34a1f1
rand_s.c
Go to the documentation of this file.
1
/*
2
* PROJECT: GCC C++ support library
3
* LICENSE: MIT (https://spdx.org/licenses/MIT)
4
* PURPOSE: Workaround for missing rand_s on pre-NT6 builds
5
* COPYRIGHT: Copyright 2026 Timo Kreuzer <timo.kreuzer@reactos.org>
6
*/
7
8
#include <stdlib.h>
9
10
errno_t
__cdecl
rand_s
(
_Out_
unsigned
int
*RandomValue)
11
{
12
if
(!RandomValue)
13
return
EINVAL
;
14
15
*RandomValue =
rand
();
16
return
0;
17
}
18
19
#ifdef _M_IX86
20
void
* _imp__rand_s =
rand_s
;
21
#else
22
void
*
__imp_rand_s
=
rand_s
;
23
#endif
errno_t
int errno_t
Definition:
corecrt.h:249
__cdecl
#define __cdecl
Definition:
corecrt.h:121
EINVAL
#define EINVAL
Definition:
errno.h:44
rand
_ACRTIMP int __cdecl rand(void)
Definition:
misc.c:59
rand_s
_ACRTIMP errno_t __cdecl rand_s(unsigned int *)
Definition:
misc.c:72
_Out_
#define _Out_
Definition:
no_sal2.h:160
__imp_rand_s
void * __imp_rand_s
Definition:
rand_s.c:22
sdk
lib
gcc-compat
rand_s.c
Generated on Fri Mar 27 2026 06:15:37 for ReactOS by
1.9.6