diff options
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/transport/udp_simple.cpp | 13 | ||||
-rw-r--r-- | host/lib/types.cpp | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/host/lib/transport/udp_simple.cpp b/host/lib/transport/udp_simple.cpp index 5829b462b..6799ac7b2 100644 --- a/host/lib/transport/udp_simple.cpp +++ b/host/lib/transport/udp_simple.cpp @@ -35,6 +35,8 @@ using namespace uhd::transport; static bool wait_available( boost::asio::ip::udp::socket &socket, double timeout ){ + #if defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32) + //setup timeval for timeout timeval tv; tv.tv_sec = 0; @@ -46,6 +48,17 @@ static bool wait_available( FD_SET(socket.native(), &rset); return ::select(socket.native()+1, &rset, NULL, NULL, &tv) > 0; + + #else /*defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)*/ + + //FIXME: why does select fail on macintosh? + for (size_t i = 0; i < size_t(timeout*1e3); i++){ + if (socket.available()) return true; + boost::this_thread::sleep(boost::posix_time::milliseconds(1)); + } + return false; + + #endif /*defined(UHD_PLATFORM_LINUX) || defined(UHD_PLATFORM_WIN32)*/ } /*********************************************************************** diff --git a/host/lib/types.cpp b/host/lib/types.cpp index 8ccb664d5..bea20a4aa 100644 --- a/host/lib/types.cpp +++ b/host/lib/types.cpp @@ -21,6 +21,7 @@ #include <uhd/types/clock_config.hpp> #include <uhd/types/stream_cmd.hpp> #include <uhd/types/metadata.hpp> +#include <uhd/types/ranges.hpp> #include <uhd/types/time_spec.hpp> #include <uhd/types/device_addr.hpp> #include <uhd/types/mac_addr.hpp> @@ -40,6 +41,12 @@ using namespace uhd; /*********************************************************************** + * ranges template instantiation + **********************************************************************/ +template struct uhd::meta_range_t<float>; +template struct uhd::meta_range_t<double>; + +/*********************************************************************** * tune request **********************************************************************/ tune_request_t::tune_request_t(double target_freq): |