From: Piotr Caban piotr@codeweavers.com
--- dlls/msvcrt/math.c | 3 ++- include/msvcrt/complex.h | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index b639718eb77..682010e3aa5 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -2988,7 +2988,7 @@ double CDECL cimag(_Dcomplex z) return z._Val[1]; }
-#ifndef __i386__ +#if !defined(__i386__) || defined(__MINGW32__) || defined(_MSC_VER) _Fcomplex CDECL _FCbuild(float r, float i) { _Fcomplex ret; @@ -2997,6 +2997,7 @@ _Fcomplex CDECL _FCbuild(float r, float i) return ret; } #else +#undef _FCbuild ULONGLONG CDECL _FCbuild(float r, float i) { union diff --git a/include/msvcrt/complex.h b/include/msvcrt/complex.h index 2d7009c470c..33a4a65ec6f 100644 --- a/include/msvcrt/complex.h +++ b/include/msvcrt/complex.h @@ -24,4 +24,24 @@ typedef struct _C_float_complex typedef _C_double_complex _Dcomplex; typedef _C_float_complex _Fcomplex;
+#if defined(__i386__) && !defined(__MINGW32__) && !defined(_MSC_VER) +/* Note: this should return a _Fcomplex, but calling convention for returning + * structures is different between Windows and gcc on i386. */ +_ACRTIMP unsigned __int64 __cdecl _FCbuild(float, float); + +static inline _Fcomplex __cdecl __wine__FCbuild(float r, float i) +{ + union { + _Fcomplex c; + unsigned __int64 ull; + } u; + u.ull = _FCbuild(r, i); + return u.c; +} +#define _FCbuild(r, i) __wine__FCbuild_wrapper(r, i) + +#else +_ACRTIMP _Fcomplex __cdecl _FCbuild(float, float); +#endif + #endif /* _COMPLEX_H_DEFINED */