ReactOS
0.4.15-dev-8636-g945e856
_controlfp_s.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS CRT library
3
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4
* PURPOSE: Implementation of _controlfp_s (adapted from wine msvcrt/math.c)
5
* COPYRIGHT: Copyright 2000 Jon Griffiths
6
* Copyright 2010 Piotr Caban
7
* Copyright 2021 Roman Masanin <36927roma@gmail.com>
8
*/
9
10
#include <precomp.h>
11
#include <float.h>
12
13
#ifdef _M_ARM
14
#define INVALID_MASK ~(_MCW_EM | _MCW_RC | _MCW_DN)
15
#else
16
#define INVALID_MASK ~(_MCW_EM | _MCW_IC | _MCW_RC | _MCW_PC | _MCW_DN)
17
#endif
18
19
int
CDECL
_controlfp_s
(
unsigned
int
*
cur
,
unsigned
int
newval,
unsigned
int
mask
)
20
{
21
unsigned
int
val
;
22
23
if
(!
MSVCRT_CHECK_PMT
((newval &
mask
&
INVALID_MASK
) == 0))
24
{
25
if
(
cur
) *
cur
=
_controlfp
(0, 0);
/* retrieve it anyway */
26
return
EINVAL
;
27
}
28
val
=
_controlfp
(newval,
mask
);
29
if
(
cur
) *
cur
=
val
;
30
return
0;
31
}
_controlfp_s
int CDECL _controlfp_s(unsigned int *cur, unsigned int newval, unsigned int mask)
Definition:
_controlfp_s.c:19
INVALID_MASK
#define INVALID_MASK
Definition:
_controlfp_s.c:16
EINVAL
#define EINVAL
Definition:
acclib.h:90
CDECL
#define CDECL
Definition:
compat.h:29
cur
FxCollectionEntry * cur
Definition:
fxresourceapi.cpp:412
mask
GLenum GLint GLuint mask
Definition:
glext.h:6028
val
GLuint GLfloat * val
Definition:
glext.h:7180
_controlfp
__MINGW_NOTHROW _CRTIMP unsigned int __cdecl _controlfp(_In_ unsigned int unNew, _In_ unsigned int unMask)
MSVCRT_CHECK_PMT
#define MSVCRT_CHECK_PMT(x)
Definition:
mbstowcs_s.c:26
sdk
lib
crt
float
_controlfp_s.c
Generated on Tue Sep 10 2024 06:13:07 for ReactOS by
1.9.6