2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Add include guard to fftw3 in library and compile tests (#768)

This commit is contained in:
Matt Borland
2022-02-28 18:58:09 +01:00
committed by GitHub
parent c001a885dc
commit 722bddbd68
4 changed files with 27 additions and 2 deletions

View File

@@ -8,13 +8,20 @@
#include <cstddef>
#include <cmath>
#include <stdexcept>
#include <fftw3.h>
#include <boost/math/constants/constants.hpp>
#ifdef BOOST_HAS_FLOAT128
#include <quadmath.h>
#endif
#ifdef __has_include
# if __has_include(<fftw3.h>)
# include <fftw3.h>
# else
# error "This feature is unavailable without fftw3 installed"
#endif
#endif
namespace boost { namespace math { namespace interpolators { namespace detail {
template<typename Real>

View File

@@ -7,7 +7,6 @@
#define BOOST_MATH_SPECIAL_CHEBYSHEV_TRANSFORM_HPP
#include <cmath>
#include <type_traits>
#include <fftw3.h>
#include <boost/math/constants/constants.hpp>
#include <boost/math/special_functions/chebyshev.hpp>
@@ -15,6 +14,14 @@
#include <quadmath.h>
#endif
#ifdef __has_include
# if __has_include(<fftw3.h>)
# include <fftw3.h>
# else
# error "This feature is unavailable without fftw3 installed"
#endif
#endif
namespace boost { namespace math {
namespace detail{

View File

@@ -6,6 +6,8 @@
// A sanity check that this file
// #includes all the files that it needs to.
//
#if __has_include(<fftw3.h>)
#include <boost/math/interpolators/cardinal_trigonometric.hpp>
//
// Note this header includes no other headers, this is
@@ -23,3 +25,6 @@ void compile_and_link_test()
boost::math::interpolators::cardinal_trigonometric<std::vector<double>> s(data, 3, 2);
check_result<double>(s(1.0));
}
#else
void compile_and_link_test() {}
#endif // __has_include

View File

@@ -6,6 +6,8 @@
// Basic sanity check that header <boost/math/special_functions/chebyshev_transform.hpp>
// #includes all the files that it needs to.
//
#if __has_include(<fftw3.h>)
#include <boost/math/special_functions/chebyshev_transform.hpp>
//
// Note this header includes no other headers, this is
@@ -19,3 +21,7 @@ void compile_and_link_test()
boost::math::chebyshev_transform<double> test(f, 0.0, 1.0);
check_result<double>(test(1.0));
}
#else
void compile_and_link_test() {}
#endif // __has_include