diff --git a/dll/win32/ucrtbase/stubs.c b/dll/win32/ucrtbase/stubs.c index d3cf32a8062..3758e2af1b1 100644 --- a/dll/win32/ucrtbase/stubs.c +++ b/dll/win32/ucrtbase/stubs.c @@ -1,6 +1,9 @@ #include #include +#include +#define _USE_MATH_DEFINES +#include // atexit is needed by libsupc++ extern int __cdecl _crt_atexit(void (__cdecl*)(void)); @@ -9,13 +12,11 @@ int __cdecl atexit(void (__cdecl* function)(void)) return _crt_atexit(function); } -void* __cdecl malloc(size_t); void* __cdecl operator_new(size_t size) { return malloc(size); } -void free(void*); void _cdecl operator_delete(void *mem) { free(mem); @@ -48,26 +49,25 @@ int __cdecl __acrt_initialize_sse2(void) double fma(double x, double y, double z) { - __debugbreak(); - return 0.; + // Simplistic implementation + return (x * y) + z; } float fmaf(float x, float y, float z) { - __debugbreak(); - return 0.; + // Simplistic implementation + return (x * y) + z; } double log2(double x) { - __debugbreak(); - return 0.; + // Simplistic implementation: log2(x) = log(x) / log(2) + return log(x) * M_LOG2E; } float log2f(float x) { - __debugbreak(); - return 0.; + return (float)log2((double)x); } long int lrint(double x)