X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Fcomplex.h;h=008b3c7e3b7d6190cb864892aa7b2bad3f1aa2cf;hb=60ab365cae24063b0f21821860ca16fb63e81f81;hp=23bab7d5593042e3c878707ad22dc86cdb843a1d;hpb=5ff2a118c64224789b7286830912425e58831b2b;p=musl diff --git a/include/complex.h b/include/complex.h index 23bab7d5..008b3c7e 100644 --- a/include/complex.h +++ b/include/complex.h @@ -7,9 +7,9 @@ extern "C" { #define complex _Complex #ifdef __GNUC__ -#define _Complex_I (__extension__ 1.0fi) +#define _Complex_I (__extension__ (0.0f+1.0fi)) #else -#define _Complex_I 1.0fi +#define _Complex_I (0.0f+1.0fi) #endif #define I _Complex_I @@ -103,7 +103,7 @@ long double creall(long double complex); #ifndef __cplusplus #define __CIMAG(x, t) \ - ((union { _Complex t __z; t __xy[2]; }){(_Complex t)(x)}.__xy[1]) + (+(union { _Complex t __z; t __xy[2]; }){(_Complex t)(x)}.__xy[1]) #define creal(x) ((double)(x)) #define crealf(x) ((float)(x)) @@ -116,7 +116,7 @@ long double creall(long double complex); #if __STDC_VERSION__ >= 201112L #if defined(_Imaginary_I) -#define __CMPLX(x, y, t) ((t)(x) + _Imaginary_I*(t)(y))) +#define __CMPLX(x, y, t) ((t)(x) + _Imaginary_I*(t)(y)) #elif defined(__clang__) #define __CMPLX(x, y, t) (+(_Complex t){ (t)(x), (t)(y) }) #else