From feb72389aa4e1070fcbc888280ea65b178176460 Mon Sep 17 00:00:00 2001 From: ZoRo Date: Thu, 26 Aug 2021 09:48:17 +0100 Subject: Update source to be compatible with emscripten --- NaiveFFT/fft.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'NaiveFFT/fft.h') diff --git a/NaiveFFT/fft.h b/NaiveFFT/fft.h index f1ee783..80ae6cc 100644 --- a/NaiveFFT/fft.h +++ b/NaiveFFT/fft.h @@ -11,10 +11,21 @@ #include #include #include +#include +#include +#if __EMSCRIPTEN__ +#include +#endif -void fft_if(double *x_i, double *x_q, int n, int inv); -void ffti_shuffle_1(double *x_i, double *x_q, uint64_t n); -void fft_1(double *x_i, double *x_q, uint64_t n, uint64_t inv); -void dft(double *x_i, double *x_q, int n, int inv); +#ifdef __EMSCRIPTEN__ +#define KEEPALIVE EMSCRIPTEN_KEEPALIVE +#else +#define KEEPALIVE +#endif + +void KEEPALIVE fft_if(double *x_i, double *x_q, int n, int inv); +void KEEPALIVE ffti_shuffle_1(double *x_i, double *x_q, uint64_t n); +void KEEPALIVE fft_1(double *x_i, double *x_q, uint64_t n, uint64_t inv); +void KEEPALIVE dft(double *x_i, double *x_q, int n, int inv); #endif /* fft_h */ -- cgit v1.2.3