summaryrefslogtreecommitdiff
path: root/NaiveFFT/fft.h
diff options
context:
space:
mode:
authorZoRo <dos21h@gmail.com>2021-08-26 09:48:17 +0100
committerZoRo <dos21h@gmail.com>2021-08-26 09:48:17 +0100
commitfeb72389aa4e1070fcbc888280ea65b178176460 (patch)
tree4e8f0561958fb51842a13adec237184a70de276a /NaiveFFT/fft.h
parent3834bc793857aae02198d8f4c8a8373957269678 (diff)
downloadNaiveFFT-feb72389aa4e1070fcbc888280ea65b178176460.tar.gz
NaiveFFT-feb72389aa4e1070fcbc888280ea65b178176460.zip
Update source to be compatible with emscripten
Diffstat (limited to 'NaiveFFT/fft.h')
-rw-r--r--NaiveFFT/fft.h19
1 files changed, 15 insertions, 4 deletions
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 <stdlib.h>
#include <stdio.h>
#include <math.h>
+#include <stdint.h>
+#include <unistd.h>
+#if __EMSCRIPTEN__
+#include <emscripten/emscripten.h>
+#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 */