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
48028c64
Commit
48028c64
authored
Nov 17, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Import ilogb() from musl.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
44e122e0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
26 deletions
+37
-26
configure
configure
+0
-2
configure.ac
configure.ac
+0
-2
math.c
dlls/msvcrt/math.c
+37
-16
config.h.in
include/config.h.in
+0
-6
No files found.
configure
View file @
48028c64
...
...
@@ -19512,8 +19512,6 @@ for ac_func in \
expm1f
\
fma
\
fmaf
\
ilogb
\
ilogbf
\
j0
\
j1
\
jn
\
...
...
configure.ac
View file @
48028c64
...
...
@@ -2698,8 +2698,6 @@ AC_CHECK_FUNCS(\
expm1f \
fma \
fmaf \
ilogb \
ilogbf \
j0 \
j1 \
jn \
...
...
dlls/msvcrt/math.c
View file @
48028c64
...
...
@@ -4402,32 +4402,53 @@ double CDECL MSVCR120_creal(_Dcomplex z)
return
z
.
x
;
}
/*********************************************************************
* ilogb (MSVCR120.@)
*
* Copied from musl: src/math/ilogb.c
*/
int
CDECL
MSVCR120_ilogb
(
double
x
)
{
if
(
!
x
)
return
MSVCRT_FP_ILOGB0
;
if
(
isnan
(
x
))
return
MSVCRT_FP_ILOGBNAN
;
if
(
isinf
(
x
))
return
MSVCRT_INT_MAX
;
union
{
double
f
;
UINT64
i
;
}
u
=
{
x
};
int
e
=
u
.
i
>>
52
&
0x7ff
;
#ifdef HAVE_ILOGB
return
ilogb
(
x
);
#else
return
logb
(
x
);
#endif
if
(
!
e
)
{
u
.
i
<<=
12
;
if
(
u
.
i
==
0
)
return
MSVCRT_FP_ILOGB0
;
/* subnormal x */
for
(
e
=
-
0x3ff
;
u
.
i
>>
63
==
0
;
e
--
,
u
.
i
<<=
1
);
return
e
;
}
if
(
e
==
0x7ff
)
return
u
.
i
<<
12
?
MSVCRT_FP_ILOGBNAN
:
MSVCRT_INT_MAX
;
return
e
-
0x3ff
;
}
/*********************************************************************
* ilogbf (MSVCR120.@)
*
* Copied from musl: src/math/ilogbf.c
*/
int
CDECL
MSVCR120_ilogbf
(
float
x
)
{
if
(
!
x
)
return
MSVCRT_FP_ILOGB0
;
if
(
isnan
(
x
))
return
MSVCRT_FP_ILOGBNAN
;
if
(
isinf
(
x
))
return
MSVCRT_INT_MAX
;
union
{
float
f
;
UINT32
i
;
}
u
=
{
x
};
int
e
=
u
.
i
>>
23
&
0xff
;
#ifdef HAVE_ILOGBF
return
ilogbf
(
x
);
#else
return
logbf
(
x
);
#endif
if
(
!
e
)
{
u
.
i
<<=
9
;
if
(
u
.
i
==
0
)
return
MSVCRT_FP_ILOGB0
;
/* subnormal x */
for
(
e
=
-
0x7f
;
u
.
i
>>
31
==
0
;
e
--
,
u
.
i
<<=
1
);
return
e
;
}
if
(
e
==
0xff
)
return
u
.
i
<<
9
?
MSVCRT_FP_ILOGBNAN
:
MSVCRT_INT_MAX
;
return
e
-
0x7f
;
}
/*********************************************************************
* ilogbl (MSVCR120.@)
*/
int
CDECL
MSVCR120_ilogbl
(
LDOUBLE
x
)
{
return
MSVCR120_ilogb
(
x
);
...
...
include/config.h.in
View file @
48028c64
...
...
@@ -288,12 +288,6 @@
/* Define to 1 if you have the `if_nameindex' function. */
#undef HAVE_IF_NAMEINDEX
/* Define to 1 if you have the `ilogb' function. */
#undef HAVE_ILOGB
/* Define to 1 if you have the `ilogbf' function. */
#undef HAVE_ILOGBF
/* Define to 1 if you have the <inet/mib2.h> header file. */
#undef HAVE_INET_MIB2_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