From 9ca79a2cc14c18758baa1adfaead49e70d80003e Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Tue, 16 Oct 2007 09:37:06 +0000 Subject: Fix for 'multiple symbol definitions' vs 'symbol not defined' dilemna. I think the solution is to wrap the globals in a struct, declare it in a header, and wrap with a definition guard, then define _once_ at library init time. (Sounds like a recipe for something...) --- src/xtract_globals_private.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/xtract_globals_private.h') diff --git a/src/xtract_globals_private.h b/src/xtract_globals_private.h index dd0f36f..cab1660 100644 --- a/src/xtract_globals_private.h +++ b/src/xtract_globals_private.h @@ -26,11 +26,24 @@ #ifdef XTRACT_FFT #include -extern fftwf_plan spectrum_plan, - autocorrelation_fft_plan_1, - autocorrelation_fft_plan_2, - dct_plan; -#endif +struct xtract_fft_plans_ { + + fftwf_plan spectrum_plan; + fftwf_plan autocorrelation_fft_plan_1; + fftwf_plan autocorrelation_fft_plan_2; + fftwf_plan dct_plan; + +}; +#ifdef DEFINE_GLOBALS +#define GLOBAL +#else +#define GLOBAL extern #endif +GLOBAL struct xtract_fft_plans_ fft_plans; + +#endif /* FFT */ + +#endif /* Header guard */ + -- cgit v1.2.3