diff options
Diffstat (limited to 'host')
-rw-r--r-- | host/CMakeLists.txt | 2 | ||||
-rw-r--r-- | host/docs/build.rst | 2 | ||||
-rw-r--r-- | host/include/uhd/utils/CMakeLists.txt | 1 | ||||
-rw-r--r-- | host/include/uhd/utils/exception.hpp | 38 | ||||
-rw-r--r-- | host/lib/utils.cpp | 9 |
5 files changed, 50 insertions, 2 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt index c309af7e5..f2725e4b3 100644 --- a/host/CMakeLists.txt +++ b/host/CMakeLists.txt @@ -75,7 +75,7 @@ ENDIF(WIN32) # Setup Boost ######################################################################## SET(Boost_ADDITIONAL_VERSIONS "1.42.0" "1.42") -FIND_PACKAGE(Boost 1.37 REQUIRED COMPONENTS +FIND_PACKAGE(Boost 1.36 REQUIRED COMPONENTS date_time filesystem program_options diff --git a/host/docs/build.rst b/host/docs/build.rst index 81e61475e..d28682764 100644 --- a/host/docs/build.rst +++ b/host/docs/build.rst @@ -40,7 +40,7 @@ CMake ^^^^^^^^^^^^^^^^ Boost ^^^^^^^^^^^^^^^^ -* **Version:** at least 3.7 unix, at least 4.0 windows +* **Version:** at least 3.6 unix, at least 4.0 windows * **Required for:** build time + run time * **Download URL:** http://www.boost.org/users/download/ * **Download URL (windows installer):** http://www.boostpro.com/download diff --git a/host/include/uhd/utils/CMakeLists.txt b/host/include/uhd/utils/CMakeLists.txt index 2831ab0b0..f588c6310 100644 --- a/host/include/uhd/utils/CMakeLists.txt +++ b/host/include/uhd/utils/CMakeLists.txt @@ -18,6 +18,7 @@ INSTALL(FILES algorithm.hpp assert.hpp + exception.hpp gain_handler.hpp props.hpp safe_main.hpp diff --git a/host/include/uhd/utils/exception.hpp b/host/include/uhd/utils/exception.hpp new file mode 100644 index 000000000..40e81fae0 --- /dev/null +++ b/host/include/uhd/utils/exception.hpp @@ -0,0 +1,38 @@ +// +// Copyright 2010 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 +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. +// + +#ifndef INCLUDED_UHD_UTILS_EXCEPTION_HPP +#define INCLUDED_UHD_UTILS_EXCEPTION_HPP + +#include <uhd/config.hpp> +#include <boost/current_function.hpp> +#include <stdexcept> +#include <string> + +/*! + * Create a formated string with throw-site information. + * Fills in the function name, file name, and line number. + * \param what the std::exeption message + * \return the formatted exception message + */ +#define UHD_THROW_SITE_INFO(what) std::string( \ + std::string(what) + "\n" + \ + " in " + std::string(BOOST_CURRENT_FUNCTION) + "\n" + \ + " at " + std::string(__FILE__) + ":" + BOOST_STRINGIZE(__LINE__) + "\n" \ +) + +#endif /* INCLUDED_UHD_UTILS_EXCEPTION_HPP */ diff --git a/host/lib/utils.cpp b/host/lib/utils.cpp index 3a1e5aa3f..d2f4dfc6e 100644 --- a/host/lib/utils.cpp +++ b/host/lib/utils.cpp @@ -15,11 +15,20 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // +#include <uhd/utils/assert.hpp> #include <uhd/utils/props.hpp> +#include <stdexcept> using namespace uhd; /*********************************************************************** + * Assert + **********************************************************************/ +assert_error::assert_error(const std::string &what) : std::runtime_error(what){ + /* NOP */ +} + +/*********************************************************************** * Props **********************************************************************/ named_prop_t::named_prop_t( |