# HG changeset patch # User Chris Cannam # Date 1488733998 0 # Node ID 25e023bad200ec8882d5ec331c9675f396d32841 # Parent fb3e0ca3e700c2dc5c75c0749dd85383b2e06da5 Choose another method (which should actually work) to override linkage for KissFFT diff -r fb3e0ca3e700 -r 25e023bad200 src/vamp-sdk/FFTimpl.cpp --- a/src/vamp-sdk/FFTimpl.cpp Fri Feb 24 15:46:22 2017 +0000 +++ b/src/vamp-sdk/FFTimpl.cpp Sun Mar 05 17:13:18 2017 +0000 @@ -2,7 +2,7 @@ // Override C linkage for KissFFT headers. So long as we have already // included all of the other (system etc) headers KissFFT depends on, // this should work out OK -#undef __cplusplus +#define KISSFFT_USE_CPP_LINKAGE 1 namespace Kiss { @@ -30,3 +30,9 @@ } +// Check that this worked, i.e. that we have our own suitably +// hacked KissFFT header which set this after making the +// appropriate change +#ifndef KISSFFT_USED_CPP_LINKAGE +#error "KissFFT header lacks specific linkage adjustment needed for Vamp SDK" +#endif diff -r fb3e0ca3e700 -r 25e023bad200 src/vamp-sdk/ext/kiss_fft.h --- a/src/vamp-sdk/ext/kiss_fft.h Fri Feb 24 15:46:22 2017 +0000 +++ b/src/vamp-sdk/ext/kiss_fft.h Sun Mar 05 17:13:18 2017 +0000 @@ -6,9 +6,11 @@ #include #include +#ifndef KISSFFT_USE_CPP_LINKAGE #ifdef __cplusplus extern "C" { #endif +#endif /* ATTENTION! @@ -117,8 +119,14 @@ #define kiss_fftr_next_fast_size_real(n) \ (kiss_fft_next_fast_size( ((n)+1)>>1)<<1) +#ifndef KISSFFT_USE_CPP_LINKAGE #ifdef __cplusplus } #endif +#endif + +#ifdef KISSFFT_USE_CPP_LINKAGE +#define KISSFFT_USED_CPP_LINKAGE 1 +#endif #endif diff -r fb3e0ca3e700 -r 25e023bad200 src/vamp-sdk/ext/kiss_fftr.h --- a/src/vamp-sdk/ext/kiss_fftr.h Fri Feb 24 15:46:22 2017 +0000 +++ b/src/vamp-sdk/ext/kiss_fftr.h Sun Mar 05 17:13:18 2017 +0000 @@ -2,9 +2,12 @@ #define KISS_FTR_H #include "kiss_fft.h" + +#ifndef KISSFFT_USE_CPP_LINKAGE #ifdef __cplusplus extern "C" { #endif +#endif /* @@ -40,7 +43,14 @@ #define kiss_fftr_free free +#ifndef KISSFFT_USE_CPP_LINKAGE #ifdef __cplusplus } #endif #endif + +#ifdef KISSFFT_USE_CPP_LINKAGE +#define KISSFFT_USED_CPP_LINKAGE 1 +#endif + +#endif