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
f4de92a4
Commit
f4de92a4
authored
Apr 29, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import round implementation from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
69ad3c11
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
20 deletions
+32
-20
configure
configure
+0
-1
configure.ac
configure.ac
+0
-1
math.c
dlls/msvcrt/math.c
+32
-1
unixlib.c
dlls/msvcrt/unixlib.c
+0
-13
unixlib.h
dlls/msvcrt/unixlib.h
+0
-1
config.h.in
include/config.h.in
+0
-3
No files found.
configure
View file @
f4de92a4
...
...
@@ -19651,7 +19651,6 @@ for ac_func in \
remquof
\
rint
\
rintf
\
round
\
tgamma
\
tgammaf
\
trunc
\
...
...
configure.ac
View file @
f4de92a4
...
...
@@ -2694,7 +2694,6 @@ AC_CHECK_FUNCS(\
remquof \
rint \
rintf \
round \
tgamma \
tgammaf \
trunc \
...
...
dlls/msvcrt/math.c
View file @
f4de92a4
...
...
@@ -87,6 +87,14 @@ static inline float fp_barrierf(float x)
return
y
;
}
#if _MSVCR_VER>=120
static
inline
double
fp_barrier
(
double
x
)
{
volatile
double
y
=
x
;
return
y
;
}
#endif
static
inline
double
CDECL
ret_nan
(
BOOL
update_sw
)
{
double
x
=
1
.
0
;
...
...
@@ -4321,10 +4329,33 @@ short CDECL _dclass(double x)
/*********************************************************************
* round (MSVCR120.@)
*
* Copied from musl: src/math/round.c
*/
double
CDECL
round
(
double
x
)
{
return
unix_funcs
->
round
(
x
);
static
const
double
toint
=
1
/
DBL_EPSILON
;
ULONGLONG
llx
=
*
(
ULONGLONG
*
)
&
x
;
int
e
=
llx
>>
52
&
0x7ff
;
double
y
;
if
(
e
>=
0x3ff
+
52
)
return
x
;
if
(
llx
>>
63
)
x
=
-
x
;
if
(
e
<
0x3ff
-
1
)
return
0
*
*
(
double
*
)
&
llx
;
y
=
fp_barrier
(
x
+
toint
)
-
toint
-
x
;
if
(
y
>
0
.
5
)
y
=
y
+
x
-
1
;
else
if
(
y
<=
-
0
.
5
)
y
=
y
+
x
+
1
;
else
y
=
y
+
x
;
if
(
llx
>>
63
)
y
=
-
y
;
return
y
;
}
/*********************************************************************
...
...
dlls/msvcrt/unixlib.c
View file @
f4de92a4
...
...
@@ -754,18 +754,6 @@ static float CDECL unix_rintf(float x)
}
/*********************************************************************
* round
*/
static
double
CDECL
unix_round
(
double
x
)
{
#ifdef HAVE_ROUND
return
round
(
x
);
#else
return
unix_rint
(
x
);
#endif
}
/*********************************************************************
* sin
*/
static
double
CDECL
unix_sin
(
double
x
)
...
...
@@ -948,7 +936,6 @@ static const struct unix_funcs funcs =
unix_remquof
,
unix_rint
,
unix_rintf
,
unix_round
,
unix_sin
,
unix_sinf
,
unix_sinh
,
...
...
dlls/msvcrt/unixlib.h
View file @
f4de92a4
...
...
@@ -90,7 +90,6 @@ struct unix_funcs
float
(
CDECL
*
remquof
)(
float
x
,
float
y
,
int
*
quo
);
double
(
CDECL
*
rint
)(
double
x
);
float
(
CDECL
*
rintf
)(
float
x
);
double
(
CDECL
*
round
)(
double
x
);
double
(
CDECL
*
sin
)(
double
x
);
float
(
CDECL
*
sinf
)(
float
x
);
double
(
CDECL
*
sinh
)(
double
x
);
...
...
include/config.h.in
View file @
f4de92a4
...
...
@@ -690,9 +690,6 @@
/* Define to 1 if you have the `rintf' function. */
#undef HAVE_RINTF
/* Define to 1 if you have the `round' function. */
#undef HAVE_ROUND
/* Define to 1 if you have the <sasl/sasl.h> header file. */
#undef HAVE_SASL_SASL_H
...
...
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