diff options
Diffstat (limited to 'gr-analog/lib')
-rw-r--r-- | gr-analog/lib/CMakeLists.txt | 20 | ||||
-rw-r--r-- | gr-analog/lib/fastnoise_source_X_impl.cc.t | 6 | ||||
-rw-r--r-- | gr-analog/lib/noise_source_X_impl.cc.t | 6 | ||||
-rw-r--r-- | gr-analog/lib/pll_carriertracking_cc_impl.cc | 36 | ||||
-rw-r--r-- | gr-analog/lib/pll_carriertracking_cc_impl.h | 4 | ||||
-rw-r--r-- | gr-analog/lib/pll_freqdet_cf_impl.cc | 34 | ||||
-rw-r--r-- | gr-analog/lib/pll_freqdet_cf_impl.h | 4 | ||||
-rw-r--r-- | gr-analog/lib/pll_refout_cc_impl.cc | 36 | ||||
-rw-r--r-- | gr-analog/lib/pll_refout_cc_impl.h | 4 | ||||
-rw-r--r-- | gr-analog/lib/qa_analog.cc | 4 | ||||
-rw-r--r-- | gr-analog/lib/qa_analog.h | 2 | ||||
-rw-r--r-- | gr-analog/lib/qa_sincos.cc | 75 | ||||
-rw-r--r-- | gr-analog/lib/qa_sincos.h | 47 | ||||
-rw-r--r-- | gr-analog/lib/sincos.cc | 89 | ||||
-rw-r--r-- | gr-analog/lib/test_gr_analog.cc | 4 |
15 files changed, 72 insertions, 299 deletions
diff --git a/gr-analog/lib/CMakeLists.txt b/gr-analog/lib/CMakeLists.txt index 74169da4a2..5719eac7a5 100644 --- a/gr-analog/lib/CMakeLists.txt +++ b/gr-analog/lib/CMakeLists.txt @@ -27,9 +27,9 @@ include_directories( ${GR_ANALOG_INCLUDE_DIRS} ${GR_FILTER_INCLUDE_DIRS} ${GR_FFT_INCLUDE_DIRS} - ${GNURADIO_CORE_INCLUDE_DIRS} + ${GR_BLOCKS_INCLUDE_DIRS} + ${GNURADIO_RUNTIME_INCLUDE_DIRS} ${VOLK_INCLUDE_DIRS} - ${GRUEL_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ) @@ -49,7 +49,7 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py " #!${PYTHON_EXECUTABLE} import sys, os, re -sys.path.append('${GR_CORE_PYTHONPATH}') +sys.path.append('${GR_RUNTIME_PYTHONPATH}') os.environ['srcdir'] = '${CMAKE_CURRENT_SOURCE_DIR}' os.chdir('${CMAKE_CURRENT_BINARY_DIR}') @@ -138,7 +138,6 @@ list(APPEND analog_sources quadrature_demod_cf_impl.cc rail_ff_impl.cc simple_squelch_cc_impl.cc - sincos.cc ) #Add Windows DLL resource file if using MSVC @@ -158,7 +157,7 @@ ENDIF(MSVC) list(APPEND analog_libs volk - gnuradio-core + gnuradio-runtime gnuradio-filter ${Boost_LIBRARIES} ) @@ -181,14 +180,13 @@ if(ENABLE_TESTING) list(APPEND test_gr_analog_sources ${CMAKE_CURRENT_SOURCE_DIR}/test_gr_analog.cc ${CMAKE_CURRENT_SOURCE_DIR}/qa_analog.cc - ${CMAKE_CURRENT_SOURCE_DIR}/qa_sincos.cc ) add_executable(test-gr-analog ${test_gr_analog_sources}) target_link_libraries( test-gr-analog - gnuradio-core + gnuradio-runtime gnuradio-analog ${Boost_LIBRARIES} ${CPPUNIT_LIBRARIES} @@ -198,11 +196,3 @@ if(ENABLE_TESTING) GR_ADD_TEST(test_gr_analog test-gr-analog) endif(ENABLE_TESTING) - -CHECK_CXX_SOURCE_COMPILES(" - #define _GNU_SOURCE - #include <math.h> - int main(){double x, sin, cos; sincos(x, &sin, &cos); return 0;} - " HAVE_SINCOS -) -GR_ADD_COND_DEF(HAVE_SINCOS) diff --git a/gr-analog/lib/fastnoise_source_X_impl.cc.t b/gr-analog/lib/fastnoise_source_X_impl.cc.t index 25ad8073aa..706ddbbf84 100644 --- a/gr-analog/lib/fastnoise_source_X_impl.cc.t +++ b/gr-analog/lib/fastnoise_source_X_impl.cc.t @@ -59,7 +59,7 @@ namespace gr { void @IMPL_NAME@::set_type(noise_type_t type) { - gruel::scoped_lock l(d_setlock); + gr::thread::scoped_lock l(d_setlock); d_type = type; generate(); } @@ -67,7 +67,7 @@ namespace gr { void @IMPL_NAME@::set_amplitude(float ampl) { - gruel::scoped_lock l(d_setlock); + gr::thread::scoped_lock l(d_setlock); d_ampl = ampl; generate(); } @@ -123,7 +123,7 @@ namespace gr { gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - gruel::scoped_lock l(d_setlock); + gr::thread::scoped_lock l(d_setlock); @TYPE@ *out = (@TYPE@*)output_items[0]; diff --git a/gr-analog/lib/noise_source_X_impl.cc.t b/gr-analog/lib/noise_source_X_impl.cc.t index 40e2517d2e..7f371b2cfd 100644 --- a/gr-analog/lib/noise_source_X_impl.cc.t +++ b/gr-analog/lib/noise_source_X_impl.cc.t @@ -57,14 +57,14 @@ namespace gr { void @IMPL_NAME@::set_type(noise_type_t type) { - gruel::scoped_lock l(d_setlock); + gr::thread::scoped_lock l(d_setlock); d_type = type; } void @IMPL_NAME@::set_amplitude(float ampl) { - gruel::scoped_lock l(d_setlock); + gr::thread::scoped_lock l(d_setlock); d_ampl = ampl; } @@ -73,7 +73,7 @@ namespace gr { gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { - gruel::scoped_lock l(d_setlock); + gr::thread::scoped_lock l(d_setlock); @TYPE@ *out = (@TYPE@*)output_items[0]; diff --git a/gr-analog/lib/pll_carriertracking_cc_impl.cc b/gr-analog/lib/pll_carriertracking_cc_impl.cc index c53e0f4332..9213a5e681 100644 --- a/gr-analog/lib/pll_carriertracking_cc_impl.cc +++ b/gr-analog/lib/pll_carriertracking_cc_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2010-2012 Free Software Foundation, Inc. + * Copyright 2006,2010-2013 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -50,7 +50,7 @@ namespace gr { : gr_sync_block("pll_carriertracking_cc", gr_make_io_signature(1, 1, sizeof(gr_complex)), gr_make_io_signature(1, 1, sizeof(gr_complex))), - gri_control_loop(loop_bw, max_freq, min_freq), + blocks::control_loop(loop_bw, max_freq, min_freq), d_locksig(0), d_lock_threshold(0), d_squelch_enable(false) { } @@ -130,98 +130,98 @@ namespace gr { void pll_carriertracking_cc_impl::set_loop_bandwidth(float bw) { - gri_control_loop::set_loop_bandwidth(bw); + blocks::control_loop::set_loop_bandwidth(bw); } void pll_carriertracking_cc_impl::set_damping_factor(float df) { - gri_control_loop::set_damping_factor(df); + blocks::control_loop::set_damping_factor(df); } void pll_carriertracking_cc_impl::set_alpha(float alpha) { - gri_control_loop::set_alpha(alpha); + blocks::control_loop::set_alpha(alpha); } void pll_carriertracking_cc_impl::set_beta(float beta) { - gri_control_loop::set_beta(beta); + blocks::control_loop::set_beta(beta); } void pll_carriertracking_cc_impl::set_frequency(float freq) { - gri_control_loop::set_frequency(freq); + blocks::control_loop::set_frequency(freq); } void pll_carriertracking_cc_impl::set_phase(float phase) { - gri_control_loop::set_phase(phase); + blocks::control_loop::set_phase(phase); } void pll_carriertracking_cc_impl::set_min_freq(float freq) { - gri_control_loop::set_min_freq(freq); + blocks::control_loop::set_min_freq(freq); } void pll_carriertracking_cc_impl::set_max_freq(float freq) { - gri_control_loop::set_max_freq(freq); + blocks::control_loop::set_max_freq(freq); } float pll_carriertracking_cc_impl::get_loop_bandwidth() const { - return gri_control_loop::get_loop_bandwidth(); + return blocks::control_loop::get_loop_bandwidth(); } float pll_carriertracking_cc_impl::get_damping_factor() const { - return gri_control_loop::get_damping_factor(); + return blocks::control_loop::get_damping_factor(); } float pll_carriertracking_cc_impl::get_alpha() const { - return gri_control_loop::get_alpha(); + return blocks::control_loop::get_alpha(); } float pll_carriertracking_cc_impl::get_beta() const { - return gri_control_loop::get_beta(); + return blocks::control_loop::get_beta(); } float pll_carriertracking_cc_impl::get_frequency() const { - return gri_control_loop::get_frequency(); + return blocks::control_loop::get_frequency(); } float pll_carriertracking_cc_impl::get_phase() const { - return gri_control_loop::get_phase(); + return blocks::control_loop::get_phase(); } float pll_carriertracking_cc_impl::get_min_freq() const { - return gri_control_loop::get_min_freq(); + return blocks::control_loop::get_min_freq(); } float pll_carriertracking_cc_impl::get_max_freq() const { - return gri_control_loop::get_max_freq(); + return blocks::control_loop::get_max_freq(); } } /* namespace analog */ diff --git a/gr-analog/lib/pll_carriertracking_cc_impl.h b/gr-analog/lib/pll_carriertracking_cc_impl.h index d67223db82..c809736709 100644 --- a/gr-analog/lib/pll_carriertracking_cc_impl.h +++ b/gr-analog/lib/pll_carriertracking_cc_impl.h @@ -24,13 +24,11 @@ #define INCLUDED_ANALOG_PLL_CARRIERTRACKING_CC_IMPL_H #include <analog/pll_carriertracking_cc.h> -#include <gri_control_loop.h> namespace gr { namespace analog { - class pll_carriertracking_cc_impl - : public pll_carriertracking_cc, public gri_control_loop + class pll_carriertracking_cc_impl : public pll_carriertracking_cc { private: float d_locksig,d_lock_threshold; diff --git a/gr-analog/lib/pll_freqdet_cf_impl.cc b/gr-analog/lib/pll_freqdet_cf_impl.cc index 27e8d02aa4..9e55d9bedb 100644 --- a/gr-analog/lib/pll_freqdet_cf_impl.cc +++ b/gr-analog/lib/pll_freqdet_cf_impl.cc @@ -47,7 +47,7 @@ namespace gr { : gr_sync_block("pll_freqdet_cf", gr_make_io_signature(1, 1, sizeof(gr_complex)), gr_make_io_signature(1, 1, sizeof(float))), - gri_control_loop(loop_bw, max_freq, min_freq) + blocks::control_loop(loop_bw, max_freq, min_freq) { } @@ -100,98 +100,98 @@ namespace gr { void pll_freqdet_cf_impl::set_loop_bandwidth(float bw) { - gri_control_loop::set_loop_bandwidth(bw); + blocks::control_loop::set_loop_bandwidth(bw); } void pll_freqdet_cf_impl::set_damping_factor(float df) { - gri_control_loop::set_damping_factor(df); + blocks::control_loop::set_damping_factor(df); } void pll_freqdet_cf_impl::set_alpha(float alpha) { - gri_control_loop::set_alpha(alpha); + blocks::control_loop::set_alpha(alpha); } void pll_freqdet_cf_impl::set_beta(float beta) { - gri_control_loop::set_beta(beta); + blocks::control_loop::set_beta(beta); } void pll_freqdet_cf_impl::set_frequency(float freq) { - gri_control_loop::set_frequency(freq); + blocks::control_loop::set_frequency(freq); } void pll_freqdet_cf_impl::set_phase(float phase) { - gri_control_loop::set_phase(phase); + blocks::control_loop::set_phase(phase); } void pll_freqdet_cf_impl::set_min_freq(float freq) { - gri_control_loop::set_min_freq(freq); + blocks::control_loop::set_min_freq(freq); } void pll_freqdet_cf_impl::set_max_freq(float freq) { - gri_control_loop::set_max_freq(freq); + blocks::control_loop::set_max_freq(freq); } float pll_freqdet_cf_impl::get_loop_bandwidth() const { - return gri_control_loop::get_loop_bandwidth(); + return blocks::control_loop::get_loop_bandwidth(); } float pll_freqdet_cf_impl::get_damping_factor() const { - return gri_control_loop::get_damping_factor(); + return blocks::control_loop::get_damping_factor(); } float pll_freqdet_cf_impl::get_alpha() const { - return gri_control_loop::get_alpha(); + return blocks::control_loop::get_alpha(); } float pll_freqdet_cf_impl::get_beta() const { - return gri_control_loop::get_beta(); + return blocks::control_loop::get_beta(); } float pll_freqdet_cf_impl::get_frequency() const { - return gri_control_loop::get_frequency(); + return blocks::control_loop::get_frequency(); } float pll_freqdet_cf_impl::get_phase() const { - return gri_control_loop::get_phase(); + return blocks::control_loop::get_phase(); } float pll_freqdet_cf_impl::get_min_freq() const { - return gri_control_loop::get_min_freq(); + return blocks::control_loop::get_min_freq(); } float pll_freqdet_cf_impl::get_max_freq() const { - return gri_control_loop::get_max_freq(); + return blocks::control_loop::get_max_freq(); } } /* namespace analog */ diff --git a/gr-analog/lib/pll_freqdet_cf_impl.h b/gr-analog/lib/pll_freqdet_cf_impl.h index 7acf53ebbf..3170d819b6 100644 --- a/gr-analog/lib/pll_freqdet_cf_impl.h +++ b/gr-analog/lib/pll_freqdet_cf_impl.h @@ -24,13 +24,11 @@ #define INCLUDED_ANALOG_PLL_FREQDET_CF_IMPL_H #include <analog/pll_freqdet_cf.h> -#include <gri_control_loop.h> namespace gr { namespace analog { - class pll_freqdet_cf_impl : - public pll_freqdet_cf, public gri_control_loop + class pll_freqdet_cf_impl : public pll_freqdet_cf { private: float phase_detector(gr_complex sample,float ref_phase); diff --git a/gr-analog/lib/pll_refout_cc_impl.cc b/gr-analog/lib/pll_refout_cc_impl.cc index b94e3660a3..3f0ccc7df5 100644 --- a/gr-analog/lib/pll_refout_cc_impl.cc +++ b/gr-analog/lib/pll_refout_cc_impl.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2010-2012 Free Software Foundation, Inc. + * Copyright 2004,2010-2013 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -48,7 +48,7 @@ namespace gr { : gr_sync_block("pll_refout_cc", gr_make_io_signature(1, 1, sizeof(gr_complex)), gr_make_io_signature(1, 1, sizeof(gr_complex))), - gri_control_loop(loop_bw, max_freq, min_freq) + blocks::control_loop(loop_bw, max_freq, min_freq) { } @@ -103,98 +103,98 @@ namespace gr { void pll_refout_cc_impl::set_loop_bandwidth(float bw) { - gri_control_loop::set_loop_bandwidth(bw); + blocks::control_loop::set_loop_bandwidth(bw); } void pll_refout_cc_impl::set_damping_factor(float df) { - gri_control_loop::set_damping_factor(df); + blocks::control_loop::set_damping_factor(df); } void pll_refout_cc_impl::set_alpha(float alpha) { - gri_control_loop::set_alpha(alpha); + blocks::control_loop::set_alpha(alpha); } void pll_refout_cc_impl::set_beta(float beta) { - gri_control_loop::set_beta(beta); + blocks::control_loop::set_beta(beta); } void pll_refout_cc_impl::set_frequency(float freq) { - gri_control_loop::set_frequency(freq); + blocks::control_loop::set_frequency(freq); } void pll_refout_cc_impl::set_phase(float phase) { - gri_control_loop::set_phase(phase); + blocks::control_loop::set_phase(phase); } void pll_refout_cc_impl::set_min_freq(float freq) { - gri_control_loop::set_min_freq(freq); + blocks::control_loop::set_min_freq(freq); } void pll_refout_cc_impl::set_max_freq(float freq) { - gri_control_loop::set_max_freq(freq); + blocks::control_loop::set_max_freq(freq); } float pll_refout_cc_impl::get_loop_bandwidth() const { - return gri_control_loop::get_loop_bandwidth(); + return blocks::control_loop::get_loop_bandwidth(); } float pll_refout_cc_impl::get_damping_factor() const { - return gri_control_loop::get_damping_factor(); + return blocks::control_loop::get_damping_factor(); } float pll_refout_cc_impl::get_alpha() const { - return gri_control_loop::get_alpha(); + return blocks::control_loop::get_alpha(); } float pll_refout_cc_impl::get_beta() const { - return gri_control_loop::get_beta(); + return blocks::control_loop::get_beta(); } float pll_refout_cc_impl::get_frequency() const { - return gri_control_loop::get_frequency(); + return blocks::control_loop::get_frequency(); } float pll_refout_cc_impl::get_phase() const { - return gri_control_loop::get_phase(); + return blocks::control_loop::get_phase(); } float pll_refout_cc_impl::get_min_freq() const { - return gri_control_loop::get_min_freq(); + return blocks::control_loop::get_min_freq(); } float pll_refout_cc_impl::get_max_freq() const { - return gri_control_loop::get_max_freq(); + return blocks::control_loop::get_max_freq(); } } /* namespace analog */ diff --git a/gr-analog/lib/pll_refout_cc_impl.h b/gr-analog/lib/pll_refout_cc_impl.h index 9e8ae286b1..1734b6e138 100644 --- a/gr-analog/lib/pll_refout_cc_impl.h +++ b/gr-analog/lib/pll_refout_cc_impl.h @@ -24,13 +24,11 @@ #define INCLUDED_ANALOG_PLL_REFOUT_CC_IMPL_H #include <analog/pll_refout_cc.h> -#include <gri_control_loop.h> namespace gr { namespace analog { - class pll_refout_cc_impl - : public pll_refout_cc, public gri_control_loop + class pll_refout_cc_impl : public pll_refout_cc { private: float mod_2pi (float in); diff --git a/gr-analog/lib/qa_analog.cc b/gr-analog/lib/qa_analog.cc index f1e3a45e27..c7c975a3e5 100644 --- a/gr-analog/lib/qa_analog.cc +++ b/gr-analog/lib/qa_analog.cc @@ -26,15 +26,11 @@ */ #include <qa_analog.h> -#include <qa_sincos.h> -#include <qa_rotator.h> CppUnit::TestSuite * qa_gr_analog::suite() { CppUnit::TestSuite *s = new CppUnit::TestSuite("gr-analog"); - s->addTest(gr::analog::qa_sincos::suite()); - return s; } diff --git a/gr-analog/lib/qa_analog.h b/gr-analog/lib/qa_analog.h index 458861cc91..b66b62b5fe 100644 --- a/gr-analog/lib/qa_analog.h +++ b/gr-analog/lib/qa_analog.h @@ -23,7 +23,7 @@ #ifndef _QA_GR_ANALOG_H_ #define _QA_GR_ANALOG_H_ -#include <gruel/attributes.h> +#include <attributes.h> #include <cppunit/TestSuite.h> //! collect all the tests for the gr-analog directory diff --git a/gr-analog/lib/qa_sincos.cc b/gr-analog/lib/qa_sincos.cc deleted file mode 100644 index 62642c1171..0000000000 --- a/gr-analog/lib/qa_sincos.cc +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include <qa_sincos.h> -#include <analog/sincos.h> -#include <gruel/attributes.h> -#include <cppunit/TestAssert.h> -#include <cmath> - -namespace gr { - namespace analog { - - void - qa_sincos::t1() - { - static const unsigned int N = 1000; - double c_sin, c_cos; - double gr_sin, gr_cos; - - for(unsigned i = 0; i < N; i++) { - double x = i/100.0; - c_sin = sin(x); - c_cos = cos(x); - - analog::sincos(x, &gr_sin, &gr_cos); - - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_sin, gr_sin, 0.0001); - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_cos, gr_cos, 0.0001); - } - } - - void - qa_sincos::t2() - { - static const unsigned int N = 1000; - float c_sin, c_cos; - float gr_sin, gr_cos; - - for(unsigned i = 0; i < N; i++) { - float x = i/100.0; - c_sin = sinf(x); - c_cos = cosf(x); - - analog::sincosf(x, &gr_sin, &gr_cos); - - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_sin, gr_sin, 0.0001); - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_cos, gr_cos, 0.0001); - } - } - - } /* namespace analog */ -} /* namespace gr */ diff --git a/gr-analog/lib/qa_sincos.h b/gr-analog/lib/qa_sincos.h deleted file mode 100644 index f18e879dd8..0000000000 --- a/gr-analog/lib/qa_sincos.h +++ /dev/null @@ -1,47 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef _QA_ANALOG_SINCOS_H_ -#define _QA_ANALOG_SINCOS_H_ - -#include <cppunit/extensions/HelperMacros.h> -#include <cppunit/TestCase.h> - -namespace gr { - namespace analog { - - class qa_sincos : public CppUnit::TestCase - { - CPPUNIT_TEST_SUITE(qa_sincos); - CPPUNIT_TEST(t1); - CPPUNIT_TEST(t2); - CPPUNIT_TEST_SUITE_END(); - - private: - void t1(); - void t2(); - }; - - } /* namespace analog */ -} /* namespace gr */ - -#endif /* _QA_ANALOG_SINCOS_H_ */ diff --git a/gr-analog/lib/sincos.cc b/gr-analog/lib/sincos.cc deleted file mode 100644 index 14ceeb3a29..0000000000 --- a/gr-analog/lib/sincos.cc +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2004,2010,2012 Free Software Foundation, Inc. - * - * This file is part of GNU Radio - * - * GNU Radio is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3, or (at your option) - * any later version. - * - * GNU Radio is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE // ask for GNU extensions if available -#endif - -#include <analog/sincos.h> -#include <math.h> - -namespace gr { - namespace analog { - -// ---------------------------------------------------------------- - -#if defined (HAVE_SINCOS) - - void - sincos(double x, double *sinx, double *cosx) - { - ::sincos(x, sinx, cosx); - } - -#else - - void - sincos(double x, double *sinx, double *cosx) - { - *sinx = sin(x); - *cosx = cos(x); - } - -#endif - -// ---------------------------------------------------------------- - -#if defined (HAVE_SINCOSF) - - void - sincosf(float x, float *sinx, float *cosx) - { - sincosf(x, sinx, cosx); - } - -#elif defined (HAVE_SINF) && defined (HAVE_COSF) - - void - sincosf(float x, float *sinx, float *cosx) - { - *sinx = sinf(x); - *cosx = cosf(x); - } - -#else - - void - sincosf(float x, float *sinx, float *cosx) - { - *sinx = sin(x); - *cosx = cos(x); - } - -#endif - - } /* namespace analog */ -} /* namespace gr */ diff --git a/gr-analog/lib/test_gr_analog.cc b/gr-analog/lib/test_gr_analog.cc index 00d6242699..95ee3aa8cb 100644 --- a/gr-analog/lib/test_gr_analog.cc +++ b/gr-analog/lib/test_gr_analog.cc @@ -20,6 +20,10 @@ * Boston, MA 02110-1301, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <cppunit/TextTestRunner.h> #include <cppunit/XmlOutputter.h> |