diff options
Diffstat (limited to 'host/lib/utils/load_modules.cpp')
-rw-r--r-- | host/lib/utils/load_modules.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/host/lib/utils/load_modules.cpp b/host/lib/utils/load_modules.cpp index fa9b22438..bee0d5304 100644 --- a/host/lib/utils/load_modules.cpp +++ b/host/lib/utils/load_modules.cpp @@ -1,5 +1,5 @@ // -// Copyright 2010 Ettus Research LLC +// Copyright 2010-2011 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 @@ -16,11 +16,11 @@ // #include <uhd/utils/static.hpp> +#include <uhd/exception.hpp> #include <boost/format.hpp> #include <boost/foreach.hpp> #include <boost/filesystem.hpp> #include <iostream> -#include <stdexcept> #include <string> #include <vector> @@ -33,7 +33,7 @@ namespace fs = boost::filesystem; #include <dlfcn.h> static void load_module(const std::string &file_name){ if (dlopen(file_name.c_str(), RTLD_LAZY) == NULL){ - throw std::runtime_error(str( + throw uhd::os_error(str( boost::format("dlopen failed to load \"%s\"") % file_name )); } @@ -45,7 +45,7 @@ static void load_module(const std::string &file_name){ #include <windows.h> static void load_module(const std::string &file_name){ if (LoadLibrary(file_name.c_str()) == NULL){ - throw std::runtime_error(str( + throw uhd::os_error(str( boost::format("LoadLibrary failed to load \"%s\"") % file_name )); } @@ -55,7 +55,7 @@ static void load_module(const std::string &file_name){ #ifdef HAVE_LOAD_MODULES_DUMMY static void load_module(const std::string &file_name){ - throw std::runtime_error(str( + throw uhd::not_implemented_error(str( boost::format("Module loading not supported: Cannot load \"%s\"") % file_name )); } @@ -72,7 +72,7 @@ static void load_module(const std::string &file_name){ */ static void load_module_path(const fs::path &path){ if (not fs::exists(path)){ - //std::cerr << boost::format("Module path \"%s\" not found.") % path.file_string() << std::endl; + //std::cerr << boost::format("Module path \"%s\" not found.") % path.string() << std::endl; return; } @@ -90,7 +90,7 @@ static void load_module_path(const fs::path &path){ //its not a directory, try to load it try{ - load_module(path.file_string()); + load_module(path.string()); } catch(const std::exception &err){ std::cerr << boost::format("Error: %s") % err.what() << std::endl; |