diff options
author | Vasil Velichkov <vvvelichkov@gmail.com> | 2020-01-25 00:08:16 +0200 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2020-01-24 22:59:01 -0800 |
commit | a11d2e36c63a3011ab2b3407798b766068e31d8f (patch) | |
tree | 6dcbea23cd3d0cf424695c03cb8b1931e1398159 | |
parent | ba18d52949436922fef73bb85b36b13d6d510ac4 (diff) |
fft: Add message to static_assert
In c++11 the static_assert takes two parameters while in c++17 a version
with only one parameter was added
https://en.cppreference.com/w/cpp/language/static_assert
Compilation on CentOS 7 with gcc 4.8.5 fails with
gr-fft/lib/fft.cc:164:62: error: expected ',' before ')' token
static_assert(sizeof(fftwf_complex) == sizeof(gr_complex));
-rw-r--r-- | gr-fft/lib/fft.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gr-fft/lib/fft.cc b/gr-fft/lib/fft.cc index c9c9f31990..e787f2f950 100644 --- a/gr-fft/lib/fft.cc +++ b/gr-fft/lib/fft.cc @@ -161,7 +161,8 @@ fft_complex::fft_complex(int fft_size, bool forward, int nthreads) // Hold global mutex during plan construction and destruction. planner::scoped_lock lock(planner::mutex()); - static_assert(sizeof(fftwf_complex) == sizeof(gr_complex)); + static_assert(sizeof(fftwf_complex) == sizeof(gr_complex), + "The size of fftwf_complex is not equal to gr_complex"); if (fft_size <= 0) { throw std::out_of_range("fft_impl_fftw: invalid fft_size"); @@ -218,7 +219,8 @@ fft_real_fwd::fft_real_fwd(int fft_size, int nthreads) // Hold global mutex during plan construction and destruction. planner::scoped_lock lock(planner::mutex()); - static_assert(sizeof(fftwf_complex) == sizeof(gr_complex)); + static_assert(sizeof(fftwf_complex) == sizeof(gr_complex), + "The size of fftwf_complex is not equal to gr_complex"); if (fft_size <= 0) { throw std::out_of_range("gr::fft: invalid fft_size"); @@ -275,7 +277,8 @@ fft_real_rev::fft_real_rev(int fft_size, int nthreads) // Hold global mutex during plan construction and destruction. planner::scoped_lock lock(planner::mutex()); - static_assert(sizeof(fftwf_complex) == sizeof(gr_complex)); + static_assert(sizeof(fftwf_complex) == sizeof(gr_complex), + "The size of fftwf_complex is not equal to gr_complex"); if (fft_size <= 0) { throw std::out_of_range("gr::fft::fft_real_rev: invalid fft_size"); |