Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
f2c18726
Commit
f2c18726
authored
May 17, 2021
by
Piotr Caban
Committed by
Alexandre Julliard
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import trunc implementation from musl.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5544e6de
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
22 deletions
+17
-22
configure
configure
+1
-2
configure.ac
configure.ac
+1
-2
math.c
dlls/msvcrt/math.c
+15
-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 @
f2c18726
...
...
@@ -19643,8 +19643,7 @@ for ac_func in \
remquo
\
remquof
\
tgamma
\
tgammaf
\
trunc
tgammaf
do
:
as_ac_var
=
`
$as_echo
"ac_cv_func_
$ac_func
"
|
$as_tr_sh
`
...
...
configure.ac
View file @
f2c18726
...
...
@@ -2683,8 +2683,7 @@ AC_CHECK_FUNCS(\
remquo \
remquof \
tgamma \
tgammaf \
trunc
tgammaf
)
LIBS="$ac_save_LIBS"
...
...
dlls/msvcrt/math.c
View file @
f2c18726
...
...
@@ -4981,10 +4981,24 @@ __int64 CDECL llroundf(float x)
/*********************************************************************
* trunc (MSVCR120.@)
*
* Copied from musl: src/math/trunc.c
*/
double
CDECL
trunc
(
double
x
)
{
return
unix_funcs
->
trunc
(
x
);
union
{
double
f
;
UINT64
i
;}
u
=
{
x
};
int
e
=
(
u
.
i
>>
52
&
0x7ff
)
-
0x3ff
+
12
;
UINT64
m
;
if
(
e
>=
52
+
12
)
return
x
;
if
(
e
<
12
)
e
=
1
;
m
=
-
1ULL
>>
e
;
if
((
u
.
i
&
m
)
==
0
)
return
x
;
u
.
i
&=
~
m
;
return
u
.
f
;
}
/*********************************************************************
...
...
dlls/msvcrt/unixlib.c
View file @
f2c18726
...
...
@@ -637,18 +637,6 @@ static double CDECL unix_tgamma(double x)
}
/*********************************************************************
* trunc
*/
static
double
CDECL
unix_trunc
(
double
x
)
{
#ifdef HAVE_TRUNC
return
trunc
(
x
);
#else
return
(
x
>
0
)
?
floor
(
x
)
:
ceil
(
x
);
#endif
}
/*********************************************************************
* tgammaf
*/
static
float
CDECL
unix_tgammaf
(
float
x
)
...
...
@@ -722,7 +710,6 @@ static const struct unix_funcs funcs =
unix_tanhf
,
unix_tgamma
,
unix_tgammaf
,
unix_trunc
,
};
NTSTATUS
CDECL
__wine_init_unix_lib
(
HMODULE
module
,
DWORD
reason
,
const
void
*
ptr_in
,
void
*
ptr_out
)
...
...
dlls/msvcrt/unixlib.h
View file @
f2c18726
...
...
@@ -82,7 +82,6 @@ struct unix_funcs
float
(
CDECL
*
tanhf
)(
float
x
);
double
(
CDECL
*
tgamma
)(
double
x
);
float
(
CDECL
*
tgammaf
)(
float
x
);
double
(
CDECL
*
trunc
)(
double
x
);
};
#endif
/* __UNIXLIB_H */
include/config.h.in
View file @
f2c18726
...
...
@@ -1010,9 +1010,6 @@
/* Define to 1 if you have the <tiffio.h> header file. */
#undef HAVE_TIFFIO_H
/* Define to 1 if you have the `trunc' function. */
#undef HAVE_TRUNC
/* Define to 1 if you have the `udev' library (-ludev). */
#undef HAVE_UDEV
...
...
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