The fact that this function was excluded on i386 seems to have been a mistake since the initial version where ucrtbase was added, in 599d92a26822244b9703734a6a8972a0009cdf09; many float math functions (with an -f) suffix is unavailable in ucrtbase.dll on i386, but powf does seem to have existed in all versions of the DLL that I can find.
Signed-off-by: Martin Storsjö martin@martin.st
-- v2: ucrtbase: Export powf on i386
From: Martin Storsjö martin@martin.st
The fact that this function was excluded on i386 seems to have been a mistake since the initial version where ucrtbase was added, in 599d92a26822244b9703734a6a8972a0009cdf09; many float math functions (with an -f) suffix is unavailable in ucrtbase.dll on i386, but powf does seem to have existed in all versions of the DLL that I can find.
Signed-off-by: Martin Storsjö martin@martin.st --- dlls/msvcrt/mathf.c | 7 +++++-- dlls/ucrtbase/ucrtbase.spec | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/msvcrt/mathf.c b/dlls/msvcrt/mathf.c index 4038bdb4cf7..3c87c7d0e00 100644 --- a/dlls/msvcrt/mathf.c +++ b/dlls/msvcrt/mathf.c @@ -45,7 +45,6 @@ float tanf(float x) { return tan(x); } float atan2f(float x, float y) { return atan2(x, y); } float expf(float x) { return exp(x); } float logf(float x) { return log(x); } -float powf(float x, float y) { return pow(x, y); } float sqrtf(float x) { return sqrt(x); } float floorf(float x) { return floor(x); } float ceilf(float x) { return ceil(x); } @@ -55,10 +54,14 @@ __ASM_GLOBAL_IMPORT(tanf) __ASM_GLOBAL_IMPORT(atan2f) __ASM_GLOBAL_IMPORT(expf) __ASM_GLOBAL_IMPORT(logf) -__ASM_GLOBAL_IMPORT(powf) __ASM_GLOBAL_IMPORT(sqrtf) __ASM_GLOBAL_IMPORT(floorf) __ASM_GLOBAL_IMPORT(ceilf) + +#if _MSVCR_VER < 140 +float powf(float x, float y) { return pow(x, y); } +__ASM_GLOBAL_IMPORT(powf) +#endif #endif
#if _MSVCR_VER < 120 diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index d70494dbc29..cd8f9f23898 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -1737,7 +1737,7 @@ @ cdecl _o_nexttowardf(float double) __nexttowardf @ cdecl _o_nexttowardl(double double) __nexttoward @ cdecl _o_pow(double double) pow -@ cdecl -arch=!i386 _o_powf(float float) powf +@ cdecl _o_powf(float float) powf @ cdecl _o_putc(long ptr) putc @ cdecl _o_putchar(long) putchar @ cdecl _o_puts(str) puts @@ -2449,7 +2449,7 @@ @ stub norml @ cdecl perror(str) @ cdecl pow(double double) -@ cdecl -arch=!i386 powf(float float) +@ cdecl powf(float float) @ cdecl putc(long ptr) @ cdecl putchar(long) @ cdecl puts(str)
On Thu Aug 22 10:55:53 2024 +0000, Piotr Caban wrote:
Please also update the importlib (dlls/msvcrt/mathf.c).
Ok, done (or at least attempted doing that).
This merge request was approved by Piotr Caban.