aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Corgan <nick.corgan@ettus.com>2014-01-27 11:14:54 -0800
committerNicholas Corgan <nick.corgan@ettus.com>2014-01-27 11:14:54 -0800
commit3edead271655316826864ebb8a0d9d529402f31f (patch)
tree002d6144c0edcc05792cb0dc30881480383e6617
parent6a3b07782841e86057be012dc571d93f6728e016 (diff)
downloaduhd-3edead271655316826864ebb8a0d9d529402f31f.tar.gz
uhd-3edead271655316826864ebb8a0d9d529402f31f.tar.bz2
uhd-3edead271655316826864ebb8a0d9d529402f31f.zip
Brought in UHD 3.6.2 MacPorts patches for OS X compatibility
* With OS X, boost::lexical_cast won't accept to_hex<boost::uint16_t> as a type
-rw-r--r--host/lib/usrp/dboard_id.cpp7
-rw-r--r--host/utils/b2xx_fx3_utils.cpp7
2 files changed, 10 insertions, 4 deletions
diff --git a/host/lib/usrp/dboard_id.cpp b/host/lib/usrp/dboard_id.cpp
index 3028d2a3b..557e13914 100644
--- a/host/lib/usrp/dboard_id.cpp
+++ b/host/lib/usrp/dboard_id.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010 Ettus Research LLC
+// Copyright 2010,2014 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -51,7 +51,10 @@ template <class T> struct to_hex{
dboard_id_t dboard_id_t::from_string(const std::string &string){
if (string.substr(0, 2) == "0x"){
- return dboard_id_t::from_uint16(boost::lexical_cast<to_hex<boost::uint16_t> >(string));
+ std::stringstream interpreter(string);
+ to_hex<boost::uint16_t> hh;
+ interpreter >> hh;
+ return dboard_id_t::from_uint16(hh);
}
return dboard_id_t::from_uint16(boost::lexical_cast<boost::uint16_t>(string));
}
diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp
index 96cd1f3e7..d5f829c80 100644
--- a/host/utils/b2xx_fx3_utils.cpp
+++ b/host/utils/b2xx_fx3_utils.cpp
@@ -1,5 +1,5 @@
//
-// Copyright 2010-2013 Ettus Research LLC
+// Copyright 2010-2014 Ettus Research LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -79,7 +79,10 @@ template <class T> struct to_hex{
//!parse hex-formatted ASCII text into an int
boost::uint16_t atoh(const std::string &string){
if (string.substr(0, 2) == "0x"){
- return boost::lexical_cast<to_hex<boost::uint16_t> >(string);
+ std::stringstream interpreter(string);
+ to_hex<boost::uint16_t> hh;
+ interpreter >> hh;
+ return hh.value;
}
return boost::lexical_cast<boost::uint16_t>(string);
}