diff options
author | Michael L Dickens | 2012-11-01 10:29:08 -0400 |
---|---|---|
committer | Michael L Dickens | 2012-11-01 10:29:08 -0400 |
commit | d9a292acb566c6985785352c53c9ce1e3697836c (patch) | |
tree | 6b76dbd6d98a7557c6d6d467811edf9be23ef52c | |
parent | 539e8558924ebca5b972bab687815dcc89cca2ca (diff) | |
download | gnuradio-d9a292acb566c6985785352c53c9ce1e3697836c.tar.gz gnuradio-d9a292acb566c6985785352c53c9ce1e3697836c.tar.bz2 gnuradio-d9a292acb566c6985785352c53c9ce1e3697836c.zip |
fix gr-analog to detect and compile 'sincos(f)' correctly
-rw-r--r-- | gr-analog/include/analog/sincos.h | 8 | ||||
-rw-r--r-- | gr-analog/lib/CMakeLists.txt | 9 | ||||
-rw-r--r-- | gr-analog/lib/sincos.cc | 3 |
3 files changed, 12 insertions, 8 deletions
diff --git a/gr-analog/include/analog/sincos.h b/gr-analog/include/analog/sincos.h index c262434f0..38b9d96da 100644 --- a/gr-analog/include/analog/sincos.h +++ b/gr-analog/include/analog/sincos.h @@ -27,19 +27,11 @@ namespace gr { namespace analog { - -#ifdef __cplusplus -extern "C" { -#endif // compute sine and cosine at the same time ANALOG_API void sincos(double x, double *sin, double *cos); ANALOG_API void sincosf(float x, float *sin, float *cos); -#ifdef __cplusplus -}; -#endif - } /* namespace analog */ } /* namespace gr */ diff --git a/gr-analog/lib/CMakeLists.txt b/gr-analog/lib/CMakeLists.txt index 5e7d131b0..aaf3c8656 100644 --- a/gr-analog/lib/CMakeLists.txt +++ b/gr-analog/lib/CMakeLists.txt @@ -131,6 +131,7 @@ list(APPEND analog_sources quadrature_demod_cf_impl.cc rail_ff_impl.cc simple_squelch_cc_impl.cc + sincos.cc ) list(APPEND analog_libs @@ -174,3 +175,11 @@ 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/sincos.cc b/gr-analog/lib/sincos.cc index aa72b1cd4..f3d385611 100644 --- a/gr-analog/lib/sincos.cc +++ b/gr-analog/lib/sincos.cc @@ -84,3 +84,6 @@ namespace gr { } #endif + + } /* namespace analog */ +} /* namespace gr */ |