summaryrefslogtreecommitdiffstats
path: root/host/lib/load_modules.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-04-02 12:59:38 -0700
committerJosh Blum <josh@joshknows.com>2010-04-02 12:59:38 -0700
commitf4ccb204473884126bcff6551d224e263dd5102a (patch)
treeda52cfbd2e0b023fd64f4f8a4d488253abba8713 /host/lib/load_modules.cpp
parent0da74522a5fded7b2901c4bd49c1d43f43ef376d (diff)
downloaduhd-f4ccb204473884126bcff6551d224e263dd5102a.tar.gz
uhd-f4ccb204473884126bcff6551d224e263dd5102a.tar.bz2
uhd-f4ccb204473884126bcff6551d224e263dd5102a.zip
env path separator for windows
Diffstat (limited to 'host/lib/load_modules.cpp')
-rw-r--r--host/lib/load_modules.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/host/lib/load_modules.cpp b/host/lib/load_modules.cpp
index babff1ca5..ef633325d 100644
--- a/host/lib/load_modules.cpp
+++ b/host/lib/load_modules.cpp
@@ -31,6 +31,7 @@ namespace fs = boost::filesystem;
**********************************************************************/
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
+static const std::string env_path_sep = ":";
static void load_module(const std::string &file_name){
if (dlopen(file_name.c_str(), RTLD_LAZY) == NULL){
@@ -42,6 +43,7 @@ static void load_module(const std::string &file_name){
#elif HAVE_WINDOWS_H
#include <windows.h>
+static const std::string env_path_sep = ";";
static void load_module(const std::string &file_name){
if (LoadLibrary(file_name.c_str()) == NULL){
@@ -52,6 +54,7 @@ static void load_module(const std::string &file_name){
}
#else
+static const std::string env_path_sep = ":";
static void load_module(const std::string &file_name){
throw std::runtime_error(str(
@@ -108,7 +111,7 @@ UHD_STATIC_BLOCK(load_modules){
//split the path at the path separators
std::vector<std::string> module_paths;
- boost::split(module_paths, env_module_path, boost::is_any_of(":;"));
+ boost::split(module_paths, env_module_path, boost::is_any_of(env_path_sep));
//load modules in each path
BOOST_FOREACH(const std::string &module_path, module_paths){