X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=include%2Fcomplex.h;h=13a45c57c200e9f671f738f66efb8ea6cf5945a9;hp=b4bcb22efc818d05a294bf86e7bb178ea986dbb8;hb=2d0f495e7bbcc1b17bf118b939e347e2d771fa2f;hpb=2d321fa0627caa62272fcff8fb5303f1a5cbce39 diff --git a/include/complex.h b/include/complex.h index b4bcb22e..13a45c57 100644 --- a/include/complex.h +++ b/include/complex.h @@ -112,6 +112,13 @@ 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) + +#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) + #ifdef __cplusplus } #endif