[PATCH] ucrtbase: Add ilogb* functions.

Nikolay Sivov nsivov at codeweavers.com
Thu Jan 24 08:09:43 CST 2019


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 configure                                     |  3 ++
 configure.ac                                  |  3 ++
 .../api-ms-win-crt-math-l1-1-0.spec           |  6 ++--
 dlls/msvcr120/msvcr120.spec                   |  6 ++--
 dlls/msvcr120_app/msvcr120_app.spec           |  6 ++--
 dlls/msvcrt/math.c                            | 30 +++++++++++++++++++
 dlls/ucrtbase/ucrtbase.spec                   |  6 ++--
 include/config.h.in                           |  9 ++++++
 8 files changed, 57 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index b3a360e72e..2aa938e81c 100755
--- a/configure
+++ b/configure
@@ -18605,6 +18605,9 @@ for ac_func in \
 	exp2f \
 	expm1 \
 	expm1f \
+	ilogb \
+	ilogbf \
+	ilogbl \
 	j0 \
 	j1 \
 	jn \
diff --git a/configure.ac b/configure.ac
index 119c4cef0e..fc9b0d2346 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2743,6 +2743,9 @@ AC_CHECK_FUNCS(\
 	exp2f \
 	expm1 \
 	expm1f \
+	ilogb \
+	ilogbf \
+	ilogbl \
 	j0 \
 	j1 \
 	jn \
diff --git a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec
index 0d645e5587..55fa1e594d 100644
--- a/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec
+++ b/dlls/api-ms-win-crt-math-l1-1-0/api-ms-win-crt-math-l1-1-0.spec
@@ -254,9 +254,9 @@
 @ cdecl -arch=arm,x86_64,arm64 fmodf(float float) ucrtbase.fmodf
 @ cdecl frexp(double ptr) ucrtbase.frexp
 @ cdecl hypot(double double) ucrtbase.hypot
-@ stub ilogb
-@ stub ilogbf
-@ stub ilogbl
+@ cdecl ilogb(double) ucrtbase.ilogb
+@ cdecl ilogbf(float) ucrtbase.ilogbf
+@ cdecl ilogbl(double) ucrtbase.ilogbl
 @ cdecl ldexp(double long) ucrtbase.ldexp
 @ cdecl lgamma(double) ucrtbase.lgamma
 @ cdecl lgammaf(float) ucrtbase.lgammaf
diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec
index 4e25c6898d..0bfecaffcb 100644
--- a/dlls/msvcr120/msvcr120.spec
+++ b/dlls/msvcr120/msvcr120.spec
@@ -2207,9 +2207,9 @@
 @ cdecl gets_s(ptr long) MSVCRT_gets_s
 @ cdecl getwc(ptr) MSVCRT_getwc
 @ cdecl getwchar() MSVCRT_getwchar
-@ stub ilogb
-@ stub ilogbf
-@ stub ilogbl
+@ cdecl ilogb(double) MSVCR120_ilogb
+@ cdecl ilogbf(float) MSVCR120_ilogbf
+@ cdecl ilogbl(double) MSVCR120_ilogbl
 @ stub imaxabs
 @ stub imaxdiv
 @ cdecl is_wctype(long long) ntdll.iswctype
diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec
index c1f6e0bcf0..4d3d31b9b3 100644
--- a/dlls/msvcr120_app/msvcr120_app.spec
+++ b/dlls/msvcr120_app/msvcr120_app.spec
@@ -1871,9 +1871,9 @@
 @ cdecl gets_s(ptr long) msvcr120.gets_s
 @ cdecl getwc(ptr) msvcr120.getwc
 @ cdecl getwchar() msvcr120.getwchar
-@ stub ilogb
-@ stub ilogbf
-@ stub ilogbl
+@ cdecl ilogb(double) msvcr120.ilogb
+@ cdecl ilogbf(float) msvcr120.ilogbf
+@ cdecl ilogbl(double) msvcr120.ilogbl
 @ stub imaxabs
 @ stub imaxdiv
 @ cdecl isalnum(long) msvcr120.isalnum
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c
index d4785d3508..9dd576c05e 100644
--- a/dlls/msvcrt/math.c
+++ b/dlls/msvcrt/math.c
@@ -3395,4 +3395,34 @@ double CDECL MSVCR120_creal(_Dcomplex z)
     return z.x;
 }
 
+int CDECL MSVCR120_ilogb(double x)
+{
+#ifdef HAVE_ILOGB
+    return ilogb(x);
+#else
+    FIXME( "not implemented\n" );
+    return 0;
+#endif
+}
+
+int CDECL MSVCR120_ilogbf(float x)
+{
+#ifdef HAVE_ILOGBF
+    return ilogbf(x);
+#else
+    FIXME( "not implemented\n" );
+    return 0;
+#endif
+}
+
+int CDECL MSVCR120_ilogbl(LDOUBLE x)
+{
+#ifdef HAVE_ILOGBL
+    return ilogbl(x);
+#else
+    FIXME( "not implemented\n" );
+    return 0;
+#endif
+}
+
 #endif /* _MSVCR_VER>=120 */
diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec
index cb45aa5b87..3cb5e6a58e 100644
--- a/dlls/ucrtbase/ucrtbase.spec
+++ b/dlls/ucrtbase/ucrtbase.spec
@@ -2341,9 +2341,9 @@
 @ cdecl getwc(ptr) MSVCRT_getwc
 @ cdecl getwchar() MSVCRT_getwchar
 @ cdecl hypot(double double) _hypot
-@ stub ilogb
-@ stub ilogbf
-@ stub ilogbl
+@ cdecl ilogb(double) MSVCR120_ilogb
+@ cdecl ilogbf(float) MSVCR120_ilogbf
+@ cdecl ilogbl(double) MSVCR120_ilogbl
 @ stub imaxabs
 @ stub imaxdiv
 @ cdecl is_wctype(long long) ntdll.iswctype
diff --git a/include/config.h.in b/include/config.h.in
index c5a3cb4807..bc87327c0b 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -300,6 +300,15 @@
 /* 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 `ilogbl' function. */
+#undef HAVE_ILOGBL
+
 /* Define to 1 if you have the `inet_addr' function. */
 #undef HAVE_INET_ADDR
 
-- 
2.20.1




More information about the wine-devel mailing list