From f4ccb204473884126bcff6551d224e263dd5102a Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 2 Apr 2010 12:59:38 -0700 Subject: env path separator for windows --- host/lib/load_modules.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'host/lib/load_modules.cpp') 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 +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 +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 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){ -- cgit v1.2.3