FFTW / fftw3

DO NOT CHECK OUT THESE FILES FROM GITHUB UNLESS YOU KNOW WHAT YOU ARE DOING. (See below.)
GNU General Public License v2.0
2.76k stars 667 forks source link

complex.h include doesn't change fftwf_complex base type #284

Closed nick87720z closed 2 years ago

nick87720z commented 2 years ago

According to documentation, including "complex.h" in C should change fftw_complex to be like "double complex". The only difference for me is that I use float (though on my PC it's also 64bit), thus I use fftwf_complex, linking with float lib version.

gcc language option: -std=gnu11

I expected following to work:

#include <complex.h>
#include <fftw3.h>
...
fftwf_complex _t = 0.6 + 0.4 * I;
sample_t amp = cabsf( _t) * c->norm_factor;

But fftwf_complex remains an array, producing these errors:

fftw - 3.3.10

nick87720z commented 2 years ago

I'm appologizing - i forgot to check if fftw3.h could be included earlier in some headers, and it did. Thus, this bug is invalid.