annotate src/vamp-sdk/FFTimpl.cpp @ 525:8c18bdaad04f c++11-mutex

Avoid simple static allocation of mutex, as it could lead to mutex being destroyed before last adapter that needs to use it (since adapters are usually also static)
author Chris Cannam
date Mon, 09 Sep 2019 10:24:13 +0100
parents 90571dcc371a
children
rev   line source
Chris@449 1
Chris@449 2 // Override C linkage for KissFFT headers. So long as we have already
Chris@449 3 // included all of the other (system etc) headers KissFFT depends on,
Chris@449 4 // this should work out OK
Chris@501 5 #define VAMP_KISSFFT_USE_CPP_LINKAGE 1
Chris@449 6
Chris@449 7 namespace Kiss {
Chris@449 8
Chris@449 9 #ifdef SINGLE_PRECISION_FFT
Chris@449 10 #pragma message("Using single-precision FFTs")
Chris@501 11 typedef float vamp_kiss_fft_scalar;
Chris@501 12 #define vamp_kiss_fft_scalar float
Chris@449 13 #else
Chris@501 14 typedef double vamp_kiss_fft_scalar;
Chris@501 15 #define vamp_kiss_fft_scalar double
Chris@449 16 #endif
Chris@449 17
Chris@501 18 #include "ext/vamp_kiss_fft.c"
Chris@501 19 #include "ext/vamp_kiss_fftr.c"
Chris@449 20
Chris@501 21 #undef vamp_kiss_fft_scalar // leaving only the namespaced typedef
Chris@449 22
Chris@449 23 }
Chris@449 24
Chris@493 25 // Check that this worked, i.e. that we have our own suitably
Chris@493 26 // hacked KissFFT header which set this after making the
Chris@493 27 // appropriate change
Chris@501 28 #ifndef VAMP_KISSFFT_USED_CPP_LINKAGE
Chris@493 29 #error "KissFFT header lacks specific linkage adjustment needed for Vamp SDK"
Chris@493 30 #endif