diff options
author | Josh Blum <josh@joshknows.com> | 2011-11-25 10:41:51 -0500 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-25 10:41:51 -0500 |
commit | 5574e1ec084bf6bc9b18e0c63880fbff96301396 (patch) | |
tree | 4fc2f201c17cadb52ba6810f0a714f8300e50ef2 /host/include | |
parent | 06d0032772a24175f76d82e460932023acaaec2e (diff) | |
download | uhd-5574e1ec084bf6bc9b18e0c63880fbff96301396.tar.gz uhd-5574e1ec084bf6bc9b18e0c63880fbff96301396.tar.bz2 uhd-5574e1ec084bf6bc9b18e0c63880fbff96301396.zip |
uhd: fix so MSVC client apps dont rely on min/max
Diffstat (limited to 'host/include')
-rw-r--r-- | host/include/uhd/device_deprecated.ipp | 6 |
1 files 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); } |