See the code below. It compiles fine on Linux, and also with the Sun compiler on
both Open Solaris (x86) and Solaris 10 (SPARC).
However, it fails with every gcc version I've tried, and every Solaris system (3
tested).
This is what I expect, which is what I get on Linux
I've submitted bug reports for Solaris 10 (SPARC)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42753
and Open Solaris (x86)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42755
Can anyone suggest a workaround?
Dave
drkirkby@hawk:~$ cat simple_complex.c
#include "stdio.h"
#include "complex.h"
#if defined(_Complex_I)
#define CYTHON_CCOMPLEX 1
#else
#define CYTHON_CCOMPLEX 0
#endif
#if CYTHON_CCOMPLEX
typedef double _Complex __pyx_t_double_complex;
#else
typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
#if CYTHON_CCOMPLEX
static __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x,
double y) {
return x + y*(__pyx_t_double_complex)_Complex_I;
//return 0;
}
#else
static __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x,
double y) {
__pyx_t_double_complex z;
z.real = x;
z.imag = y;
return z;
}
#endif
int main(int argc, char** argv) {
printf("CYTHON_CCOMPLEX %d\n", CYTHON_CCOMPLEX);
return 0;
}