From 9ec656dc05c2de041a4460b803118f05bca6900d Mon Sep 17 00:00:00 2001 From: Dimitri Stolnikov Date: Sat, 2 Jun 2012 21:56:17 +0200 Subject: [PATCH] make it play nice with windows thanks to Hoernchen --- lib/osmosdr/osmosdr_src_c.cc | 3 ++- lib/rtl/rtl_source_c.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/osmosdr/osmosdr_src_c.cc b/lib/osmosdr/osmosdr_src_c.cc index 318d1c3..f563861 100644 --- a/lib/osmosdr/osmosdr_src_c.cc +++ b/lib/osmosdr/osmosdr_src_c.cc @@ -362,10 +362,11 @@ osmosdr::gain_range_t osmosdr_src_c::get_gain_range( size_t chan ) if (_dev) { int count = osmosdr_get_tuner_gains(_dev, NULL); if (count > 0) { - int gains[ count ]; + int* gains = new int[ count ]; count = osmosdr_get_tuner_gains(_dev, gains); for (int i = 0; i < count; i++) range += osmosdr::range_t( gains[i] / 10.0 ); + delete[] gains; } } diff --git a/lib/rtl/rtl_source_c.cc b/lib/rtl/rtl_source_c.cc index b961779..29ffb46 100644 --- a/lib/rtl/rtl_source_c.cc +++ b/lib/rtl/rtl_source_c.cc @@ -413,10 +413,11 @@ osmosdr::gain_range_t rtl_source_c::get_gain_range( size_t chan ) if (_dev) { int count = rtlsdr_get_tuner_gains(_dev, NULL); if (count > 0) { - int gains[ count ]; + int* gains = new int[ count ]; count = rtlsdr_get_tuner_gains(_dev, gains); for (int i = 0; i < count; i++) range += osmosdr::range_t( gains[i] / 10.0 ); + delete[] gains; } }