Module: wine Branch: master Commit: aa4d70b5dc460a910ccab32472e46dedb09c336e URL: https://gitlab.winehq.org/wine/wine/-/commit/aa4d70b5dc460a910ccab32472e46de...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Apr 10 18:35:38 2023 +0200
ntdll: Use the sin() implementation from the bundled musl library.
---
dlls/ntdll/Makefile.in | 2 +- dlls/ntdll/math.c | 45 +++++---------------------------------------- 2 files changed, 6 insertions(+), 41 deletions(-)
diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in index 7aeee3a7316..2e862c68b7e 100644 --- a/dlls/ntdll/Makefile.in +++ b/dlls/ntdll/Makefile.in @@ -2,7 +2,7 @@ EXTRADEFS = -D_NTSYSTEM_ -D_ACRTIMP= -DWINBASEAPI= MODULE = ntdll.dll UNIXLIB = ntdll.so IMPORTLIB = ntdll -IMPORTS = winecrt0 +IMPORTS = $(MUSL_PE_LIBS) winecrt0 UNIX_CFLAGS = $(UNWIND_CFLAGS) UNIX_LIBS = $(IOKIT_LIBS) $(COREFOUNDATION_LIBS) $(CORESERVICES_LIBS) $(RT_LIBS) $(PTHREAD_LIBS) $(UNWIND_LIBS) $(I386_LIBS) $(PROCSTAT_LIBS)
diff --git a/dlls/ntdll/math.c b/dlls/ntdll/math.c index aeed5d31696..c700b293a76 100644 --- a/dlls/ntdll/math.c +++ b/dlls/ntdll/math.c @@ -42,6 +42,11 @@ #define WIN32_NO_STATUS #include "ntdll_misc.h"
+double math_error( int type, const char *name, double arg1, double arg2, double retval ) +{ + return retval; +} + /* Copied from musl: src/internal/libm.h */ static inline float fp_barrierf(float x) { @@ -1818,46 +1823,6 @@ double CDECL pow( double x, double y ) return pow_exp(x, y, ehi, elo, sign_bias); }
-/********************************************************************* - * sin (NTDLL.@) - * - * Copied from musl: src/math/sin.c - */ -double CDECL sin( double x ) -{ - double y[2]; - UINT32 ix; - unsigned n; - - ix = *(ULONGLONG*)&x >> 32; - ix &= 0x7fffffff; - - /* |x| ~< pi/4 */ - if (ix <= 0x3fe921fb) { - if (ix < 0x3e500000) { /* |x| < 2**-26 */ - /* raise inexact if x != 0 and underflow if subnormal*/ - fp_barrier(ix < 0x00100000 ? x/0x1p120f : x+0x1p120f); - return x; - } - return __sin(x, 0.0, 0); - } - - /* sin(Inf or NaN) is NaN */ - if (isinf(x)) - return x - x; - if (ix >= 0x7ff00000) - return x - x; - - /* argument reduction needed */ - n = __rem_pio2(x, y); - switch (n&3) { - case 0: return __sin(y[0], y[1], 1); - case 1: return __cos(y[0], y[1]); - case 2: return -__sin(y[0], y[1], 1); - default: return -__cos(y[0], y[1]); - } -} - /********************************************************************* * sqrt (NTDLL.@) *