From 5574e1ec084bf6bc9b18e0c63880fbff96301396 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 25 Nov 2011 10:41:51 -0500 Subject: uhd: fix so MSVC client apps dont rely on min/max --- host/include/uhd/device_deprecated.ipp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/host/include/uhd/device_deprecated.ipp b/host/include/uhd/device_deprecated.ipp index 8e61c389f..698a8a508 100644 --- a/host/include/uhd/device_deprecated.ipp +++ b/host/include/uhd/device_deprecated.ipp @@ -19,6 +19,8 @@ //it supports the old send/recv functions //this was replaced by the streamer API +#define _lazymin(x, y) (((x) > (y))? (y) : (x)) + /*! * Send modes for the device send routine. */ @@ -88,7 +90,7 @@ size_t send( _tx_streamer = get_tx_stream(args); } const size_t nsamps = (send_mode == SEND_MODE_ONE_PACKET)? - std::min(nsamps_per_buff, get_max_send_samps_per_packet()) : + _lazymin(nsamps_per_buff, get_max_send_samps_per_packet()) : nsamps_per_buff; return _tx_streamer->send(buffs, nsamps, metadata, timeout); } @@ -143,7 +145,7 @@ size_t recv( _rx_streamer = get_rx_stream(args); } const size_t nsamps = (recv_mode == RECV_MODE_ONE_PACKET)? - std::min(nsamps_per_buff, get_max_recv_samps_per_packet()) : + _lazymin(nsamps_per_buff, get_max_recv_samps_per_packet()) : nsamps_per_buff; return _rx_streamer->recv(buffs, nsamps, metadata, timeout); } -- cgit v1.2.3