#ifndef Py_HAVE_C_COMPLEX
# error "this header file should only be included if Py_HAVE_C_COMPLEX is defined"
#endif
#include <complex.h>
#if !defined(CMPLX)
# if defined(__clang__) && __has_builtin(__builtin_complex)
#define CMPLX(x, y) …
#define CMPLXF(x, y) …
#define CMPLXL(x, y) …
# else
static inline double complex
CMPLX(double real, double imag)
{
double complex z;
((double *)(&z))[0] = real;
((double *)(&z))[1] = imag;
return z;
}
static inline float complex
CMPLXF(float real, float imag)
{
float complex z;
((float *)(&z))[0] = real;
((float *)(&z))[1] = imag;
return z;
}
static inline long double complex
CMPLXL(long double real, long double imag)
{
long double complex z;
((long double *)(&z))[0] = real;
((long double *)(&z))[1] = imag;
return z;
}
# endif
#endif