From 494a78940735ab31bef9a8ae1d5e58175667df37 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Fri, 4 Dec 2020 15:50:01 +0100 Subject: [PATCH] msvcrt: Use _Dcomplex definition from public header. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/math.c | 7 ++++--- dlls/msvcrt/msvcrt.h | 2 -- include/Makefile.in | 1 + include/msvcrt/complex.h | 27 +++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 include/msvcrt/complex.h diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 84f08544092..f9327659f98 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -35,6 +35,7 @@ * ==================================================== */ +#include #include #include #include @@ -4177,14 +4178,14 @@ double CDECL _except1(DWORD fpe, _FP_OPERATION_CODE op, double arg, double res, _Dcomplex* CDECL _Cbuild(_Dcomplex *ret, double r, double i) { - ret->x = r; - ret->y = i; + ret->_Val[0] = r; + ret->_Val[1] = i; return ret; } double CDECL MSVCR120_creal(_Dcomplex z) { - return z.x; + return z._Val[0]; } /********************************************************************* diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 26cb5fee996..b26d736cb18 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -283,8 +283,6 @@ extern unsigned msvcrt_create_io_inherit_block(WORD*, BYTE**) DECLSPEC_HIDDEN; extern FILE MSVCRT__iob[]; -typedef struct _complex _Dcomplex; - #ifdef __i386__ struct MSVCRT___JUMP_BUFFER { unsigned long Ebp; diff --git a/include/Makefile.in b/include/Makefile.in index a84e44998cc..9b6858b78f9 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -443,6 +443,7 @@ SOURCES = \ mstask.idl \ mstcpip.h \ msvcrt/assert.h \ + msvcrt/complex.h \ msvcrt/conio.h \ msvcrt/corecrt.h \ msvcrt/corecrt_startup.h \ diff --git a/include/msvcrt/complex.h b/include/msvcrt/complex.h new file mode 100644 index 00000000000..2d7009c470c --- /dev/null +++ b/include/msvcrt/complex.h @@ -0,0 +1,27 @@ +/** + * This file has no copyright assigned and is placed in the Public Domain. + * This file is part of the Wine project. + */ + +#ifndef _COMPLEX_H_DEFINED +#define _COMPLEX_H_DEFINED + +#include + +#ifndef _C_COMPLEX_T +#define _C_COMPLEX_T +typedef struct _C_double_complex +{ + double _Val[2]; +} _C_double_complex; + +typedef struct _C_float_complex +{ + float _Val[2]; +} _C_float_complex; +#endif + +typedef _C_double_complex _Dcomplex; +typedef _C_float_complex _Fcomplex; + +#endif /* _COMPLEX_H_DEFINED */