Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
33190b69
Commit
33190b69
authored
Jul 07, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 07, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix _control87 ambiguous return value.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f2a804b9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
math.c
dlls/msvcrt/math.c
+1
-0
misc.c
dlls/ucrtbase/tests/misc.c
+28
-0
float.h
include/msvcrt/float.h
+3
-0
No files found.
dlls/msvcrt/math.c
View file @
33190b69
...
...
@@ -1250,6 +1250,7 @@ unsigned int CDECL _control87(unsigned int newval, unsigned int mask)
__control87_2
(
newval
,
mask
,
&
flags
,
&
sse2_cw
);
if
((
flags
^
sse2_cw
)
&
(
MSVCRT__MCW_EM
|
MSVCRT__MCW_RC
))
flags
|=
MSVCRT__EM_AMBIGUOUS
;
flags
|=
sse2_cw
;
#elif defined(__x86_64__)
unsigned
long
fpword
;
unsigned
int
old_flags
;
...
...
dlls/ucrtbase/tests/misc.c
View file @
33190b69
...
...
@@ -335,6 +335,33 @@ static void test___fpe_flt_rounds(void)
ok
((
_controlfp
(
_RC_CHOP
,
_RC_CHOP
)
&
_RC_CHOP
)
==
_RC_CHOP
,
"_controlfp(_RC_CHOP, _RC_CHOP) failed
\n
"
);
ret
=
__fpe_flt_rounds
();
ok
(
ret
==
0
,
"__fpe_flt_rounds returned %d
\n
"
,
ret
);
_controlfp
(
cfp
,
_MCW_EM
|
_MCW_RC
|
_MCW_PC
);
}
static
void
test__control87_2
(
void
)
{
#ifdef __i386__
unsigned
int
x86_cw_init
,
sse2_cw_init
,
x86_cw
,
sse2_cw
,
r
;
r
=
__control87_2
(
0
,
0
,
&
x86_cw_init
,
&
sse2_cw_init
);
ok
(
r
==
1
,
"__control87_2 returned %d
\n
"
,
r
);
r
=
__control87_2
(
0
,
_EM_INVALID
,
&
x86_cw
,
NULL
);
ok
(
r
==
1
,
"__control87_2 returned %d
\n
"
,
r
);
ok
(
x86_cw
==
(
x86_cw_init
&
~
_EM_INVALID
),
"x86_cw = %x, x86_cw_init = %x
\n
"
,
x86_cw
,
x86_cw_init
);
r
=
__control87_2
(
0
,
0
,
&
x86_cw
,
&
sse2_cw
);
ok
(
r
==
1
,
"__control87_2 returned %d
\n
"
,
r
);
ok
(
x86_cw
==
(
x86_cw_init
&
~
_EM_INVALID
),
"x86_cw = %x, x86_cw_init = %x
\n
"
,
x86_cw
,
x86_cw_init
);
ok
(
sse2_cw
==
sse2_cw_init
,
"sse2_cw = %x, sse2_cw_init = %x
\n
"
,
sse2_cw
,
sse2_cw_init
);
r
=
_control87
(
0
,
0
);
ok
(
r
==
(
x86_cw
|
sse2_cw
|
_EM_AMBIGUOUS
),
"r = %x, expected %x
\n
"
,
r
,
x86_cw
|
sse2_cw
|
_EM_AMBIGUOUS
);
_control87
(
x86_cw_init
,
~
0
);
#endif
}
static
void
__cdecl
global_invalid_parameter_handler
(
...
...
@@ -1347,6 +1374,7 @@ START_TEST(misc)
test__register_onexit_function
();
test__execute_onexit_table
();
test___fpe_flt_rounds
();
test__control87_2
();
test__get_narrow_winmain_command_line
(
arg_v
[
0
]);
test__sopen_dispatch
();
test__sopen_s
();
...
...
include/msvcrt/float.h
View file @
33190b69
...
...
@@ -140,6 +140,9 @@ _ACRTIMP int __cdecl __fpe_flt_rounds(void);
unsigned
int
__cdecl
_control87
(
unsigned
int
,
unsigned
int
);
unsigned
int
__cdecl
_controlfp
(
unsigned
int
,
unsigned
int
);
errno_t
__cdecl
_controlfp_s
(
unsigned
int
*
,
unsigned
int
,
unsigned
int
);
#ifdef __i386__
int
__cdecl
__control87_2
(
unsigned
int
,
unsigned
int
,
unsigned
int
*
,
unsigned
int
*
);
#endif
double
__cdecl
_copysign
(
double
,
double
);
double
__cdecl
_chgsign
(
double
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment