3 * Copyright (C) 2018-2022 Filipe Coelho <falktx@falktx.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of
8 * the License, or any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * For a full copy of the GNU General Public License see the doc/GPL.txt file.
18 #ifndef THREAD_SAFE_FFTW_HPP_INCLUDED
19 #define THREAD_SAFE_FFTW_HPP_INCLUDED
21 #include "CarlaDefines.h"
24 // --------------------------------------------------------------------------------------------------------------------
27 #include "CarlaLibUtils.hpp"
32 typedef void (*void_func
)(void);
40 if ((libfftw3
= lib_open("libfftw3_threads.so.3")) != nullptr)
41 if (const void_func func
= lib_symbol
<void_func
>(libfftw3
, "fftw_make_planner_thread_safe"))
44 if ((libfftw3f
= lib_open("libfftw3f_threads.so.3")) != nullptr)
45 if (const void_func func
= lib_symbol
<void_func
>(libfftw3f
, "fftwf_make_planner_thread_safe"))
48 if ((libfftw3l
= lib_open("libfftw3l_threads.so.3")) != nullptr)
49 if (const void_func func
= lib_symbol
<void_func
>(libfftw3l
, "fftwl_make_planner_thread_safe"))
52 if ((libfftw3q
= lib_open("libfftw3q_threads.so.3")) != nullptr)
53 if (const void_func func
= lib_symbol
<void_func
>(libfftw3q
, "fftwq_make_planner_thread_safe"))
59 if (libfftw3
!= nullptr)
65 if (libfftw3f
!= nullptr)
71 if (libfftw3l
!= nullptr)
77 if (libfftw3q
!= nullptr)
90 CARLA_DECLARE_NON_COPYABLE(ThreadSafeFFTW
)
94 // --------------------------------------------------------------------------------------------------------------------
96 #endif // THREAD_SAFE_FFTW_HPP_INCLUDED