From de8be4a09c18fabd72f33f7e45b19ff0d735864b Mon Sep 17 00:00:00 2001 From: Martin Storsjo Date: Wed, 10 Apr 2019 21:14:28 +0300 Subject: [PATCH] msvcrt: Implement the remquo family of functions. Signed-off-by: Martin Storsjo Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- configure | 2 + configure.ac | 2 + .../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 | 38 +++++++++++++++++++ dlls/ucrtbase/ucrtbase.spec | 6 +-- include/config.h.in | 6 +++ 8 files changed, 60 insertions(+), 12 deletions(-) diff --git a/configure b/configure index a7c072bfddc..5733ea73509 100755 --- a/configure +++ b/configure @@ -19163,6 +19163,8 @@ for ac_func in \ powl \ remainder \ remainderf \ + remquo \ + remquof \ rint \ rintf \ round \ diff --git a/configure.ac b/configure.ac index bb02ec4d595..4dbb7f4f228 100644 --- a/configure.ac +++ b/configure.ac @@ -2724,6 +2724,8 @@ AC_CHECK_FUNCS(\ powl \ remainder \ remainderf \ + remquo \ + remquof \ rint \ rintf \ round \ 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 dea5094a91e..a9deec8e485 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 @@ -308,9 +308,9 @@ @ cdecl remainder(double double) ucrtbase.remainder @ cdecl remainderf(float float) ucrtbase.remainderf @ cdecl remainderl(double double) ucrtbase.remainderl -@ stub remquo -@ stub remquof -@ stub remquol +@ cdecl remquo(double double ptr) ucrtbase.remquo +@ cdecl remquof(float float ptr) ucrtbase.remquof +@ cdecl remquol(double double ptr) ucrtbase.remquol @ cdecl rint(double) ucrtbase.rint @ cdecl rintf(float) ucrtbase.rintf @ cdecl rintl(double) ucrtbase.rintl diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 8cd39ea19e9..618b9bccbc8 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -2328,9 +2328,9 @@ @ cdecl remainderf(float float) MSVCR120_remainderf @ cdecl remainderl(double double) MSVCR120_remainderl @ cdecl remove(str) MSVCRT_remove -@ stub remquo -@ stub remquof -@ stub remquol +@ cdecl remquo(double double ptr) MSVCR120_remquo +@ cdecl remquof(float float ptr) MSVCR120_remquof +@ cdecl remquol(double double ptr) MSVCR120_remquol @ cdecl rename(str str) MSVCRT_rename @ cdecl rewind(ptr) MSVCRT_rewind @ cdecl rint(double) MSVCR120_rint diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index dc3f3bd807d..26ffaf7743a 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -1991,9 +1991,9 @@ @ cdecl remainderf(float float) msvcr120.remainderf @ cdecl remainderl(double double) msvcr120.remainderl @ cdecl remove(str) msvcr120.remove -@ stub remquo -@ stub remquof -@ stub remquol +@ cdecl remquo(double double ptr) msvcr120.remquo +@ cdecl remquof(float float ptr) msvcr120.remquof +@ cdecl remquol(double double ptr) msvcr120.remquol @ cdecl rename(str str) msvcr120.rename @ cdecl rewind(ptr) msvcr120.rewind @ cdecl rint(double) msvcr120.rint diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 754e46ce66d..c893c83a69a 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -3272,6 +3272,44 @@ LDOUBLE CDECL MSVCR120_remainderl(LDOUBLE x, LDOUBLE y) return MSVCR120_remainder(x, y); } +/********************************************************************* + * remquo (MSVCR120.@) + */ +double CDECL MSVCR120_remquo(double x, double y, int *quo) +{ +#ifdef HAVE_REMQUO + if(!finite(x)) *MSVCRT__errno() = MSVCRT_EDOM; + if(isnan(y) || y==0.0) *MSVCRT__errno() = MSVCRT_EDOM; + return remquo(x, y, quo); +#else + FIXME( "not implemented\n" ); + return 0.0; +#endif +} + +/********************************************************************* + * remquof (MSVCR120.@) + */ +float CDECL MSVCR120_remquof(float x, float y, int *quo) +{ +#ifdef HAVE_REMQUOF + if(!finitef(x)) *MSVCRT__errno() = MSVCRT_EDOM; + if(isnan(y) || y==0.0f) *MSVCRT__errno() = MSVCRT_EDOM; + return remquof(x, y, quo); +#else + FIXME( "not implemented\n" ); + return 0.0f; +#endif +} + +/********************************************************************* + * remquol (MSVCR120.@) + */ +LDOUBLE CDECL MSVCR120_remquol(LDOUBLE x, LDOUBLE y, int *quo) +{ + return MSVCR120_remquo(x, y, quo); +} + /********************************************************************* * lgamma (MSVCR120.@) */ diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index d218aa3a7b7..1866f1b8b0b 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -2463,9 +2463,9 @@ @ cdecl remainderf(float float) MSVCR120_remainderf @ cdecl remainderl(double double) MSVCR120_remainderl @ cdecl remove(str) MSVCRT_remove -@ stub remquo -@ stub remquof -@ stub remquol +@ cdecl remquo(double double ptr) MSVCR120_remquo +@ cdecl remquof(float float ptr) MSVCR120_remquof +@ cdecl remquol(double double ptr) MSVCR120_remquol @ cdecl rename(str str) MSVCRT_rename @ cdecl rewind(ptr) MSVCRT_rewind @ cdecl rint(double) MSVCR120_rint diff --git a/include/config.h.in b/include/config.h.in index 535f43fc91b..aeb571ab9f5 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -744,6 +744,12 @@ /* Define to 1 if you have the `remainderf' function. */ #undef HAVE_REMAINDERF +/* Define to 1 if you have the `remquo' function. */ +#undef HAVE_REMQUO + +/* Define to 1 if you have the `remquof' function. */ +#undef HAVE_REMQUOF + /* Define to 1 if the system has the type `request_sense'. */ #undef HAVE_REQUEST_SENSE