X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=include%2Fcomplex.h;h=8206e02679acc6d3a26fea3aedc5e1cf3dc81962;hp=b4bcb22efc818d05a294bf86e7bb178ea986dbb8;hb=b3175f5c48d414ba792dfb77078dd5f559abd844;hpb=2d321fa0627caa62272fcff8fb5303f1a5cbce39 diff --git a/include/complex.h b/include/complex.h index b4bcb22e..8206e026 100644 --- a/include/complex.h +++ b/include/complex.h @@ -112,6 +112,15 @@ long double creall(long double complex); #define cimagf(x) __CIMAG(x, float) #define cimagl(x) __CIMAG(x, long double) +#define __CMPLX(x, y, t) \ + ((union { _Complex t __z; t __xy[2]; }){.__xy = {(x),(y)}}.__z) + +#if __STDC_VERSION__ >= 201112L +#define CMPLX(x, y) __CMPLX(x, y, double) +#define CMPLXF(x, y) __CMPLX(x, y, float) +#define CMPLXL(x, y) __CMPLX(x, y, long double) +#endif + #ifdef __cplusplus } #endif